I am using a form that has a lot of validate rules and messages and I am using submitHandler to submit a AjaxSubmit then.
This is OK, if I want to send form on demand which I usually do. But on the same page I’d like to do a validation without submit when user first visits the page, so he can see where the errors are.
Is this possible without reentering all the validation rules and messages again?
Now I am using like:
var v = $("#form").validate({
errorClass: "dmxError",
rules: {
my rules....
},
messages: {
my messages
},
submitHandler: function(form) {
$(form).ajaxSubmit(options);
}
});
I also have options for ajax which I think are not relevant for what I try to acomplish now 😉
How do I call validate with same data without submit when the page is loaded?
I don’t mean to be rude to the one who helped me, but I think I may found a better solution.
I used: $(“#form”).valid() and this seems to trigger validation on load without submit. Because if everything is OK I see form is not submitted because there is no “submitted” response that I have, so I have validated it without submit.