How to use jQuery Validate function directly, without submit button?

I did various tests and I found that the jQuery validatefunction only works with the submit button.

I'm right? If so, how can I use jQuery validation plugins without a submit button?

+5
source share
2 answers

You can use the valid () method to call the validator directly.

It will return a bool, indicating whether the form is valid or not.

Here is an example from jQuery documentation:

$("#myform").validate();
$("a.check").click(function() {
    alert("Valid: " + $("#myform").valid());
    return false;
});
+15
source

All Articles