Mobile phone number verification (13 opening and 158,159 beginning, total 11 digits)
Copy Code code as follows:
var re;
var Ss=document.getelementbyid (' TextBox3 '). Value;
Re=/^ (13[0-9]{9}) | (15[89][0-9]{8}) $/
if (Re.test (ss))
{
document.getElementById (' Label3 '). innertext= ""; Assign value to label with InnerText
}
Else
{
document.getElementById (' Label3 '). innertext= "Please enter the correct cell phone number!" ";
document.getElementById (' ImageButton1 '). Disabled=true; Disable button with disabled
}
Verification of the mail address (contains @ and.)
Copy Code code as follows:
var re;
var Ss=document.getelementbyid (TEXTBOXID). value;
Re=/\w@\w*\.\w/
if (Re.test (ss))
document.getElementById (' Label4 '). innertext= "";
Else
{
document.getElementById (' Label4 '). innertext= "Please enter the correct email address!" ";
document.getElementById (' ImageButton1 '). Disabled=true;
}
Verification of ZIP/Postal code (cannot start with 0, total 6 digits)
Copy Code code as follows:
var Ss=document.getelementbyid (' TextBox4 '). Value;
var re=/^[1-9][0-9]{5}$/
if (Re.test (ss))
document.getElementById (' Label5 '). innertext= "";
Else
{
document.getElementById (' Label5 '). Innertext= postal Code is not in the correct format! ";
}
var r=/^13[012345789]{9}/11 digits beginning with 13 and the number 6 cannot be found after 9 digits