The validity of the mobile number is verified by JS regular method as follows:
Verify the phone number of the 130-139,150-159,180-189 number segment
<script type= "Text/javascript" > var myreg =/^ (((13[0-9]{1}) | ( 15[0-9]{1}) | (18[0-9]{1})) +\D{8}) $/; If(!myreg.test ($ ("#phone"). Val ())) { alert (' Please enter a valid mobile number! '); return false </script>
The above code is debugged under jquery. Code that does not require jquery
functionValidatemobile (MOBILE) {if(mobile.length==0) {alert (' Please enter your mobile phone number! ‘); Document.form1.mobile.focus (); return false; } if(mobile.length!=11) {alert (' Please enter a valid mobile phone number! ‘); Document.form1.mobile.focus (); return false; } varMyreg =/^ ((13[0-9]{1}) | ( 15[0-9]{1}) | (18[0-9]{1})) +\D{8}) $/; if(!myreg.test (MOBILE)) {Alert (' Please enter a valid mobile phone number! ‘); Document.form1.mobile.focus (); return false; } }
JS Regular verification mobile phone number validity