I'm using jquery validate plugin to validate my php form, now i'm stuck with validating for a custom word, what i want to do is, disable user to input two words, for example:
word1, word2.
Is there any simple way to do it, i tried with some custom methods, but i have no idea what am i doing. Is there anyone able to provide me one?
custom: {
required: true,
words: "word1,word2",
},
And in my controller
custom: function( value, element ) {
return this.optional(element) || /^-?(?:\word1,word2\)?$/.test(value);
},