javascript - How to check for a certain text value with jQuery.validate() -


I use the jQuery.validate () plugin to validate the forms of my website I am here. What am I going to do now, when a text field contains a certain string, an error is thrown. For example, suppose that the string matching is "Penguin". If the user enters the "I like penguins", then there should be an error, although the user can enter the penguin in a word without that word, it should be accepted.

Is this a valid way to validate? I can not understand it ...

Thank you!

check

  jQuery.validator.addMethod ("title penguin" , Function (value, element) {value = $ .trim (value.toLowerCase)  

()); If (this.optional (element)) / ^ ((?? Penguin).) *************************************************************************************** **********************************);)

Comments

Popular posts from this blog

Out of index C/C++ -

regex - PatternSyntaxException: while using String.ReplaceAll function in java? -

objective c - how Set autolayout for multiple dynamic buttons and labells in iOS? -