function ischeck(){
var postcode = document.getElementById("postcode").value;
if (postcode != "") { //邮政编码判断
var pattern = /^[0-9]{6}$/;
flag = pattern.test(postcode);
if (!flag) {
alert("非法的邮政编码!")
document.getElementById("postcode").focus();
return false;
}
}
}
时间: 2024-12-25 14:46:19