Determine if the mailbox
jquery verifies that the mailbox function Checksubmitemail () {if ($ ("#email"). val () = = "") {//$ ("#confirmMsg"). HTML ("<font color= ' Red ' & gt; e-mail address cannot be empty! </font> "); alert (" Mailbox cannot be empty! ") $ ("#email"). focus (); return false;} if (!$ ("#email"). Val (). Match (/^\w+ ((-\w+) | ( \.\w+)) *\@[a-za-z0-9]+ ((\.| -) [a-za-z0-9]+] *\. [a-za-z0-9]+$/) {alert ("Incorrect mailbox format");//$ ("#confirmMsg"). HTML ("<font color= ' Red ' > Mailbox format is incorrect!) Please re-enter! </font> "); $ (" #email "). focus (); return false;} return true;}
Determine if the phone number is
jquery verifies that the mobile number function Checksubmitmobil () {if ($ ("#mobile"). val () = = "") {alert ("mobile phone number cannot be empty!") ");//$ (" #moileMsg "). HTML (" <font color= ' red ' > Phone number cannot be empty! </font> "); $ (" #mobile "). focus (); return false;} if (!$ ("#mobile"). Val (). Match (/^ (((13[0-9]{1}) |159|153) +\d{8}) {alert ("cell phone number format is incorrect!) ");//$ (" #moileMsg "). HTML (" <font color= ' red ' > Phone number format incorrect!) Please re-enter! </font> "); $ (" #mobile "). focus (); return false;} return true;}
JavaScript helper Methods Series: (1) Use regular expressions to determine phone numbers and mailboxes