JS Verification Mobile Phone number

Source: Internet
Author: User

Validation of forms is essential when adding information.

The following is a verification method based on the Easyui-validatebox expansion of the opponent machine, the landline number.

   Phoneandmobile: {validator:function (value, param) {//return/(^1[3-9]{1}[0-9]{9}$) | (            ^[0-9]{1}[0-9]{2,7}$)/.test (value); return/(^[0-9]{3,4}\-[0-9]{3,8}$) | (^[0-9]{3,8}$) | (^\ ([0-9]{3,4}\) [0-9]{3,8}$] |        (^0{0,1}1[0-9]{10}$)/.test (value); }, message: ' Please enter the correct phone number or landline number (77895099) '}, Phonerex: {validator:function (value) {var rex=/( ^[0-9]{3,4}\-[0-9]{3,8}$) | (^[0-9]{3,8}$) | (^\ ([0-9]{3,4}\) [0-9]{3,8}$] |            (^0{0,1}13[0-9]{9}$)/; Area code: Front one 0, followed by 2-3 digits: 0/d{2,3}//Phone number: 7-8 digits:/d{7,8//ext.: Generally 3 digits:/d{3,}//This connection is a test            The regular expression of the phone:/^ ((0/d{2,3})-) (/d{7,8}) (-(/d{3,}))? $/var rex2=/^ ((0/d{2,3})-) (/d{7,8}) (-(/d{3,}))? $; if (rex.test (value) | |                Rex2.test (value)) {//alert (' t ' +value);            return true;}                else{//alert (' false ' +value);            return false; }}, message: ' Please enter the correct phone or cell phoneType '}, Phone: {validator:function (value, param) {return/\d{8}$|\d{4}-\d{7}$|\d{3}-\d{7}$|\        D{4}-\d{8}$/.test (value); }, message: ' Please enter the correct fixed phone number 7789509 '}, Mobile: {validator:function (value, param) {if (val            Ue.length! = one) {return false; } else {return/^ (\d{11}) |^ ((\d{7,8}) | ( \D{4}|\D{3})-(\d{7,8}) | (\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}) |            (\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})) $/.test (value); }}, message: ' Please enter the correct 11-digit mobile number '},

  

JS Verification Mobile Phone number

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.