$('#email').keyup(function(){
setTimeout(function(){
$.post('advert/crop.php', {
email:form.email.value, password:form.password.value
},
function(output){
$("#output").empty().append("<img src='loading.gif'/>");
setTimeout(function() {$('#output').html(output).fadeIn(50)}, 500);
});
}, 2000);
});
I have an input type text, I use jquery post and post back from php to check email already registered or pw too short.
I use keyup setTimeout for 2sec after, so while user typing, it will auto check.
My problem is if user type 3 words. it will post 3 times. is any way to solve this?
set up a timer only post every few sec after user finish typing