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 (" "); - } + 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