i'm using this plug in to validate a form http://bassistance.de/jquery-plugins/jquery-plugin-validation/
I've got 3 fields, and the first one is username. I want to check the availability of the username only on focusout (not keyup...) using 'remote'. The rest of the开发者_JS百科 fields validate as usual.
Can I do that? How can change the event trigger for only one field?
thanks!
Try:
$('#yourform').validate({
//...Your existing validation logic...
onfocusout: function(element){
if($(element).attr('id') == 'usernameID'){
//add your remote logic somewhere here
//or just:
$(element).valid();
}
}
});
精彩评论