JQUERY_ Contact Telephone Regular expressions

Source: Internet
Author: User

1<%@ page language= "java" import= "java.util.*" pageencoding= "UTF-8"%>2<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >345<title> Contact Us Regular Expressions </title>6<script type= "Text/javascript" src= "Js/jquery1.8.min.js" ></script>7<script type= "Text/javascript" >8$(function (){9$ ("#txtPhone"). Focus (function () {Ten$( This). Next (). Show (). Removeclass ("OnError"). Removeclass ("Onright"). AddClass ("Ontan"). HTML ("Please enter your contact number")); One}). blur (function () { A         varPATRN =/^ (0[0-9]{2,3}\-)? ([2-9][0-9]{6,7}) + (\-[0-9]{1,4})? $| (^ (13[0-9]|15[0|3|6|7|8| 9]|18[8|9]) \d{8}$)/; -         if($( This). val ()! = ""){ -             if(!patrn.exec ($ ( This). Val () )) the$( This). Next (). Removeclass ("Ontan"). AddClass ("OnError"). HTML ("Contact phone format is incorrect"); -             Else -$( This). Next (). Removeclass ("Ontan"). Removeclass ("OnError"). AddClass ("Onright"). HTML ("&nbsp;"); -         } +         Else -$( This). Next (). Removeclass ("Ontan"). AddClass ("OnError"). HTML ("Contact phone cannot be empty"); +     }); A }); at        -</script> - -<body> -<div align= "center" > -Contact <input type= "text" id= "Txtphone"/><label style= "color:red;" class= "OnError" ></label> in</div> -</body> to

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.