I'm trying to check a textarea to make sure it contains text phrase(s).
This is what I have so far but it's not working:
$.validator.addMethod(
"regex",
function(value, element, regexp) {
var check = false;
var re = new RegExp(regexp);
return this.optional(element) || re.test(value);
},
"Please include your keyword(s)."
);
$("#article_text").rules("add", { regex: "/test phrase/i" });
Any ideas? Ideally, i'd like it to check for multiple phrases and display the error if any one of them isn't included in the textarea.