This article is also a collection of a large number of JS verification of mobile phone number code, all from the network, if you are not very understanding, you can directly take us now mobile phone number verification code to use OH.
JS Verify mobile phone number
Mobile phone number verification, verify 13 series and 150-159 (excluding 154), 180, 185, 186, 187, 188, 189 several numbers, length 11 bits
function Ismobel (value)
{
if (/^13d{9}$/g.test (value) | | (/^15[0-35-9]d{8}$/g.test (value)) | |
(/^18[05-9]d{8}$/g.test (value)) {
return true;
}else{
return false;
}
}
String.prototype.isMobile = function () {
Return (/^ (?: 13d|15[89])-?d{5} (The d{3}|*{3})/.test (this. Trim ());
}
function IsMobile (MOBILE)
{
if (mobile.length!=11)
{
Alert (' Please enter a valid phone number 111cn.net! ');
Document.form1.mobile.focus ();
return false;
}
var Myreg =/^ ((13[0-9]{1}) |159) +d{8}) $/;
var myreg =/^ ((13[0-9]{1}) |159| ( 15[0-9]{1})) +d{8}) $/;
if (!myreg.test (mobile))
{
Alert (' Please enter a valid phone number www.111cn.net! ');
Document.form1.mobile.focus ();
return false;
}
return true;
}
function Yz (v) {
var a =/^ ((d{3}) | ( d{3}-))? 13d{9}|15[89]d{8}$/;
if (v.length!=11| |! V.match (a)) {
Alert ("Please enter the correct mobile phone number");
}
function Chmobilephone (SRC)
{
if (/^13d{9}$/(src) | | (/^15[8,9]d{8}$/(SRC)) {
return true;
}else{
return false;
}
}
Unction Checkmobile (Mobileno) {
if (mobileno.trim () = = "") {
return true;
}
var regu =/^[1] ([3][0-9]{1}|59|58) [0-9]{8}$/;
var re = new RegExp (Regu);
if (Re.test (Mobileno)) {
return true;
}else{
Alert ("Phone format is not correct!");
return false;
}
}
The above mobile phone number is the verification of the expression test, each has its own characteristics, fees and I do not say much more let's take a look at these regular phone number validation function bar.