I can validate my form by calling $form.validate() and $form.valid(). And so presumably these functions are called automatically when submitting a form.
But my question is: If I have a custom validation function, how can I cause it to be called automatically when these validation methods are called? That is, I want my validation function to be called when the form is submitted, but also if $form.validate() and $form.valid() are called manually.
You can use
$.validator.addMethod. So if you have an input that needs a custom validation rule, you can add the custom method to the validation process.And then in javascript