嗨我有以下功能,我需要使其仅返回false时,其他两个复选框之一被选中。需要帮助inArray
$.validator.addMethod(
"ReutersNA",
function(value, element) {
var selectedCountry = $("#Country").val();
var NorthAmerica = new Array("USA","CAN","MEX");
if($.inArray(selectedCountry,NorthAmerica) > -1) {
return true;
} else return false;
}, "Cannot select Reuters News outside of North America."
);
I need to add if($("#IQBAS, #IQPRE").is(":checked") && the above function = return true
@ RightSaidFred如果不选择#IQBAS和or #IQPRE,这仍然会返回“Can not ...”。我需要它返回味精,只有当你检查IQBAS和或IQPRE – 2010-07-12 02:10:13