Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a function in jquery.validate that will reset a single field like resetForm does for a form?

Tags:

I want to call a jquery function to manually remove errors from a single field and reset the error markup. Is there a function that does this that would be similar to the resetForm function?

like image 621
coder Avatar asked May 13 '11 21:05

coder


People also ask

What is valid () in jquery?

valid()Returns: Boolean Description: Checks whether the selected form is valid or whether all selected elements are valid.

How remove validation after field is valid using jquery?

You want the resetForm() method: var validator = $("#myform"). validate( ... ... ); $(". cancel").

What is validator addMethod in jquery?

validator. addMethod( name, method [, message ] ) Description: Add a custom validation method. It must consist of a name (must be a legal javascript identifier), a javascript based function and a default string message.


1 Answers

You can do the following to validate a single field:

$('#your_field').valid(); 

Maybe it will help someone :-)

Thanks!

like image 119
Laszlo Avatar answered Sep 18 '22 11:09

Laszlo