You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
function isPostalCode(c) {
|
|
var val = c.value;
|
|
if (val == '')
|
|
return;
|
|
if (val.length != 6) {
|
|
c.select();
|
|
c.focus();
|
|
alert('非法的邮政编码格式.');
|
|
return false;
|
|
}
|
|
var patrn = /^[0-9]+$/;
|
|
if (!patrn.exec(val)) {
|
|
c.select();
|
|
c.focus();
|
|
alert('非法的邮政编码格式.');
|
|
return false;
|
|
}
|
|
return true
|
|
}
|