嗨,我没有正确收到我的警报消息,我的代码是:
function isNumberKey( event ) {
var charCode = (event.which)? event.which: event.keyCode;
var ctrl = event.ctrlKey;
var shift1=event.shiftKey;
var zipcode=document.getElementById(zipCode).value;
if ( ctrl ) {
return true;
}
if ( ( charCode >= 95 && charCode <= 105) || (charCode >= 106 && charCode <= 123 ) ) {
return true;
}
if ( charCode == 36 || charCode == 35 || charCode == 45 || charCode == 46 || charCode == 144 || charCode == 145 ) {
return true;
}
if ( charCode >= 106 && charCode <= 123 ) {
return true;
}
if ( ( shift1 ) || charCode > 41 && (charCode < 48 || charCode > 57 ) ) {
alert("The ZIP Code entered is invalid. Please enter a 5 digit ZIP Code.");
return true;
}
}
有人可以帮忙吗?