Mobile form verification User name and phone number

Source: Internet
Author: User

<form action= "" class= "form" action= "" method= "Post" id= "Form1" >
<div class= "mt20" >
<label for= "name" class= "Namelabel" > Your name:</label><br>
<input type= "text" placeholder= "Please enter your name ..." class= "Write Write1" id= "username"/>
</div>
<div class= "mt20" >
<label for= "name" class= "Namelabel" > Contact phone:</label><br>
<input type= "Tel" placeholder= "Please enter your mobile phone number ..." class= "Write Write2" id= "Tel" maxlength= "one" />
</div>
<center>
<input type= "button" class= "Submite" value= "click Submit to get Education program" onclick= "SB ();" />
</center>

</form>

<script type= "Text/javascript" >
function sb () {
var username = document.getElementById ("username");
var tel = document.getElementById ("tel");
var rules =/^1[3,5]\d{9}$/;
if (Username.value==null | | username.value== "") {
Alert ("Please enter name");
Username.focus ();
Return
}
if (Tel.value==null | | tel.value== "") {
Alert ("Please enter your phone number");
Tel.focus ();
Return
}else if (rules.test (Tel.value)) {
Alert (' is a mobile number ');
}else {
Alert (' Not mobile number ');
}
}

</script>

Mobile form verification User name and 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.