嗨我有以下功能,我需要使其僅返回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