JS mobile phone number, zip code, area code, ID card Verification program
Mobile phone Number Inquiry
function Checkmobile () {
var smobile = Document.mobileform.mobile.value
if (!) ( /^13[0-9]d{4,8}$/.test (Smobile))) {
Alert ("Please enter your mobile number (at least the first 7 digits)");
Document.mobileform.mobile.focus ();
return false;
}
}
Postcode inquiry
function Checkpost () {
var spost = Document.postform.post.value
if (!) ( /^d{6}$/.test (Spost))) {
Alert ("Please enter 6-digit ZIP code");
Document.postform.post.focus ();
return false;
}
}
Area code Query
function Checkarea () {
var sareanum = Document.areaform.areaNum.value
if (!) ( /^d{3,5}$/.test (Sareanum))) {
Alert ("Please enter the correct area code, 3-5 digits");
Document.areaform.areaNum.focus ();
return false;
}
}
ID Card Inquiry
function Checkidcard () {
var SID = document. IDcardform.IDcard.value
if (!) ( /^d{15}$|^d{18}$|^d{17}x$/.test (SID))) {
Alert ("Please enter 15-or 18-digit ID number");
Document. IDcardform.IDcard.focus ();
return false;
}
}
function CheckIDcard15 (theform) {
var SID = IDcardform.IDcard.value
if (!) ( /^d{15}$/.test (SID))) {
Alert ("Please enter 15-digit ID number");
IDcardform.IDcard.focus ();
return false;
}
}