2

How can I force the framework to validate a specific field?

I saw somewhere that I can call $("form").validate().form() to force the entire form to validate, but I only want to check just the one field.

2 Answers 2

5

You can use the element method of the Validator object:

element( element )           Returns: Boolean

Validates a single element, returns true if it is valid, false otherwise.

Example:

$("#myform").validate().element( "#myselect" );
Sign up to request clarification or add additional context in comments.

1 Comment

Is there an easy way of refreshing the validators attached to that input?
2

Another way:

$("#myElement").valid();

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.