jquery Mailbox Format Validation code

Source: Internet
Author: User

jquery Mailbox Format Validation code:
In the form submission may need to use the mailbox verification code, the code is relatively simple, is the mailbox format judgment, if there is a difficulty may be about the use of regular expressions, here is not much to say, we can query, the following gives a section can be used to verify the code, copy paste can.
The code example is as follows:

<!DOCTYPE HTML><HTML><Head><MetaCharSet= "Utf-8"><Metaname= "Author"content= "http://www.51texiao.cn/" /><title>Ant Tribe</title><Scripttype= "Text/javascript"src= "Mytest/jquery/jquery-1.8.3.js"></Script><Scripttype= "Text/javascript">$ (document). Ready (function(){  $("#bt"). Click (function(){   if($("#email1"). Val ()=="") {alert ("The mailbox cannot be empty"); return false; }   varEmail=$("#email1"). Val (); if(!Email.match (/^ ([a-za-z0-9_-]) [email protected] ([a-za-z0-9_-]) + ((\.[ a-za-z0-9_-]{2,3}) $/) {alert ("The format is not correct! Please re-enter"); $("#email1"). focus (); }  })})</Script></Head><Body>  <formAction="#">  <inputtype= "text"ID= "Email1">  <inputtype= "button"value= "Submit"ID= "BT">  </form></Body></HTML>

The above code realizes the simple mailbox verification, the code assigns the value to be able to use after the paste.

The original address is: http://www.51texiao.cn/jqueryjiaocheng/2015/0427/249.html

jquery Mailbox Format Validation code

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.