Validate/Revalidate a single field using jQuery validator

If you have a requirement to just do a single field validation, instead of calling the form validate method which will validate all the fields, then you have to use valid() method on the element

For example if your form has field

<input type="field" name="username" id="username"/>

to validate only username field, use code

jQuery('#username').valid()

But of course you have to link the jQuery validator plugin with your form before you call this method

Related Stack overflow post link here – http://stackoverflow.com/questions/1378472/jquery-validate-can-i-re-validate-a-group-of-fields-after-changing-one

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: