JavaScript to determine whether the user entered the correct mailbox format, to determine the user entered the phone number format is correct, the following has a good example, interested friends can refer to the
The code is as follows: * * Function: To determine whether the user entered the mailbox format is correct * pass parameter: no * return value: TRUE or False/function Form_check () {var email = Document.getelementb Yid ("email"). Value; Get the mailbox address//Determine if the mailbox format is correct if (!/^w+ [-+.] w+) *@w+ ([-.] w+) *.w+ ([-.] w+) *$/.test {alert ("Mailbox format Error!"); document.getElementById ("email"). focus (); Let the mailbox text box get focus return false; return true; * * * Function: To determine whether the user entered the mobile phone number format is correct * pass parameter: no * return value: TRUE or False/function Checkmobile (s) {var regu =/^[1][0-9][0-9]{9}$/; var re = new RegExp (Regu); if (Re.test (s)) {return true; else {return false; } }