I want to validate my form as not to submit it if it equals a string.I have seen the documentation and tried adding it in my validation code.But doesn’t work.I need to know where do i need to put the code(in my file or the file that i downloaded) and if possible the code itself to fulfil my requirement.
Share
Create the method like this:
And then add the class
name-of-validation-typeto the input you want to validate.You can also pass in additional an array of parameters to the method like this:
The parameters are passed in like this:
Make sure you don’t attach the validator to the form until your document is ready. So wrap your code in
jQuery(function($) { //code to attach validator });