Adding custom validations using jQuery Validate
I generally use jquery-validate
plugin for frontend validations. It comes with handful of validator methods. Sometimes we need custom validations. Lets see how to add one.
Tha above code code adds method pan
to the validator plugin, here value
is the value of input element to which validation will be binded and element
is the element itself. We can also pass another parameter, if we need to add some complex validation.
References: jQuery.validator.addMethod()