validating a field using jquery -


rather using jquery plugin. if have 2 fields , first field required , on focus. if click or tab on next field how can check jquery see if field contains data , if doesnt append text or class next it? onblur() used or?

thanks

yeah, you're close.

you like:

$('input[name="data"]').blur(function() {     if($(this).val().length == 0)     {         // add text or whatever     } }); 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -