variable with multiple values
This is a stupid question, nonetheless I need some help. I need a validation rule to return false if the value of the variable IS NOT either USA, CAN or MEX
this doesn't work USA||CAN||MEX
$.validator.addMethod(
"ReutersNA",
function(value, element){
var selectedCountry = $("#Country").val();
if($("#IQBAS,#IQPRE").is(":checked") && (selectedCountry!="USA||CAN||MEX")) {
return false;
} else return true;
},
"Cannot select Reuters News outside of North America."
);
///////////////////////
How can I make an array of the 3 countries?
$.validator.addMethod(
"ReutersNA",
function(value, element) {
var selectedCountry = $("#Country").val();
var NorthAmerica = new Array ("USA,CAN,MEX")
if ($("#IQBAS,#IQPRE").is(":checked") && (selectedCountry!=NorthAmerica)) {
return false;
} else return true;
},
"You cannot select Reuters if you live outside of North America."
);
seems like that should work but doesn't
Kane Leins