I have a set of strings coming from database that are placed in a hidden div. e.g "CISCO", "XYZ", "VOLVO MACK". On form submission I want to validate the text field(code) shouldn't contain any of the codes above. These codes are dynamic so will change over time.
Something like this:
var ary = ["CISCO", "XYZ", "VOLVO MACK"];
$("#code_form").submit(function(){
var code = $("#code").val();
if(ary.contains?(code))
return false;
else
return true;
});