Ajax Talk - Asynchronous javascript and xml discussion board
 FAQ   Search    Usergroups      Register   Profile   Check your messages   Log in 
Signup now to enjoy a range of free membership advantages !!
Ajax Talk - Moderators Wanted
Hightlight with scriptaculous

 
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> AJAX Help
View previous topic :: View next topic  
Author Message
cronos6
New one
New one


Joined: 04 Aug 2006
Posts: 3

PostPosted: Fri Aug 04, 2006 8:25 pm    Post subject: Hightlight with scriptaculous Reply with quote

hi,

I have some problem with effects of "scriptaculous".

i have an input for login and when a user enter a letter, it check if the login enter is in my database (for each letter). This work well.

So i added an "highlight effect" on my row, like that when there is a response from the server, my row highlight from green to white and disappear (user is alert that there was some processing.
This too work well, but when i enter letters fast , my row highlight fast too, but the effect don't disappear and my row stay green. it seems it doesn't work when there is too fast processing at one time.
Back to top
View user's profile Send private message
Snyke
Forum Assistant
Forum Assistant


Joined: 20 Jun 2006
Posts: 87
Location: Zurich

PostPosted: Sat Aug 05, 2006 12:09 am    Post subject: Reply with quote

First of all I think that checking on every letter is an absolute overkill for the server, it would be bomdbarded with requests all the time. How about hooking the check (and the effect) on focus lost? This gives the user interactiv help and does disturb the interaction by flashing continually the row.
Sorry, I know this is not a real answer but it will certainly work Smile

If you really need to do a validation on every keystroke then try building some type of singleton that does not fire the effect if another is still running.
_________________
[::[ Snyke.net ]::]
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
cronos6
New one
New one


Joined: 04 Aug 2006
Posts: 3

PostPosted: Sat Aug 05, 2006 1:25 pm    Post subject: Reply with quote

in fact for every element in my form, i check with "onblur", it was just a try with "onkeyup".

But the problem appear when i submit my form.

if the user don't go on my element and validate immediately, so don't activate the onblur. I need to activate all my check on the submit button. Then every row hightlight and the problem appear.

this is how i validate my form :


<tr>
<td width="30%">Check date : <input type="text" name="input_date" id="date" onblur="check_date()"></td>
<td><span id="msg_date" class="msg"></span></td>
</tr>

...



var url = ".";
var xmlrpc = importModule("xmlrpc");
try {
var service= new xmlrpc.ServiceProxy(url,["SP_Check_Date", "SP_Check_Empty", "SP_Check_Login", "SP_Check_Number", "SP_Check_Email"]);
}catch(e){
reportException(e);
}

function check_date(){
try{
var date = $('date').value;

res = service.SP_Check_Date(variable=date);
}catch(e){
reportException(e);
}
if (res=="")
{
$("msg_date").style.backgroundImage= 'url(ok.gif)';
$('msg_date').style.display="inline";
$('msg_date').innerHTML=res;
}
else
{
$("msg_date").style.backgroundImage= 'url(Error.gif)';
$('msg_date').style.display="inline";
$('msg_date').innerHTML=res;
return false;
}

}

function_check_other_thing {
...
}


function check_form(){
if (check_email()==false | check_login()==false | check_number()==false | check_date()==false | check_empty()==false)
{
return false;
}
else
{
return true;
}
}



as you can see, on the form check, every row highlight and bing some row stay green
Sad

Maybe it's not the correct way to check a from Question
Back to top
View user's profile Send private message
Snyke
Forum Assistant
Forum Assistant


Joined: 20 Jun 2006
Posts: 87
Location: Zurich

PostPosted: Sat Aug 05, 2006 1:35 pm    Post subject: Reply with quote

Mhz ok this looks like a browser limitation. You may probably know that browser limit the number of concurrent connections to a single host to 2. It's just a wild guess, but I'd serialize the requests anyway, it will take much longer but anyway you could just do a classic server side validation if you check on submit.

Another way is to cache on the browser the validation result, the idea being that as long as a field not being edited the status does not change (e.g. if I enter a valid name and then don't change it, it will still be valid on submit). Just check if the values have changed since the last check and if not keep the status as is. By the way this is an easy way to avoid clobbering of your servers once more Razz
_________________
[::[ Snyke.net ]::]
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
cronos6
New one
New one


Joined: 04 Aug 2006
Posts: 3

PostPosted: Sat Aug 05, 2006 3:00 pm    Post subject: Reply with quote

thanks Very Happy

i will see that and change my test
Back to top
View user's profile Send private message
Snyke
Forum Assistant
Forum Assistant


Joined: 20 Jun 2006
Posts: 87
Location: Zurich

PostPosted: Sun Aug 06, 2006 10:56 am    Post subject: Reply with quote

Really hope it works ^^
_________________
[::[ Snyke.net ]::]
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> AJAX Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
 Advertisements
 XML & Copyright Notice 
    


Powered by phpBB © 2001, 2005 phpBB Group

What is according to Wikipedia: Ajax Web2.0 XML E4X


Link to our site:

  


del.icio.us digg spurl wists simpy newsvine blinklist furl blogmarks yahoo! myweb smarking ma.gnolia segnalo reddit fark technorati cosmos


Normal Bookmark


Partner Button Links:
Codecrunch.com: Webmaster Tutorials    One Ajax


Partner Text Links:
quomon | web20log | ajaxmatters | tableless | 456bereastreet | music charts | gift ideas | competitions | free xbox 360 | link trade ?


Credits:
it consultancy & project management lead generation zoekmachine optimalisatie steal these buttons seo expert