1<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">234<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>5<title></title>6<link href= "Css/style.css" rel= "stylesheet" type= "Text/css"/>7<!--introducing jquery--8<script src= ". /scripts/jquery-1.3.1.js "type=" Text/javascript "></script>9<script type= "Text/javascript" >Ten //<! [Cdata[ One$(function(){ A //if it is required, add the Red Star logo. -$ ("form:input.required"). each (function(){ - var$required = $ ("<strong class= ' High ' > *</strong>");//Creating Elements the$( This). Parent (). append ($required);//and append it to the document. - }); - //after the text box loses focus -$ (' Form:input '). Blur (function(){ + var$parent = $ ( This). Parent (); -$parent. Find (". Formtips")). Remove (); + //Verify user name A if( $( This). is (' #username ') ){ at if( This. value== "" | | This. value.length < 6 ){ - varerrormsg = ' Please enter a user name of at least 6 bits. '; -$parent. Append (' <span class= ' formtips onError ' > ' +errormsg+ ' </span> '); -}Else{ - varokmsg = ' input correct. '; -$parent. Append (' <span class= ' formtips onsuccess ' > ' +okmsg+ ' </span> '); in } - } to //Verifying Messages + if( $( This). is (' #email ') ){ - if( This. value== "" | | ( This. value!= "" && ) ) ){ the varerrormsg = ' Please enter the correct e-mail address. '; *$parent. Append (' <span class= ' formtips onError ' > ' +errormsg+ ' </span> '); $}Else{Panax Notoginseng varokmsg = ' input correct. '; -$parent. Append (' <span class= ' formtips onsuccess ' > ' +okmsg+ ' </span> '); the } + } A}). KeyUp (function(){ the$( This). Triggerhandler ("Blur"); +}). Focus (function(){ -$( This). Triggerhandler ("Blur"); $});//End Blur $ - - //submit, final verification. the$ (' #send '). Click (function(){ -$ ("form:input.required"). Trigger (' blur '));Wuyi varNumerror = $ (' form. OnError '). length; the if(numerror) { - return false; Wu } -Alert ("Registration is successful, password has been sent to your mailbox, please check.")); About }); $ - // Reset -$ (' #res '). Click (function(){ -$ (". Formtips"). Remove (); A }); + }) the //]]> -</script> $ the<body> the the<form method= "POST" action= "" > the<div class= "int" > -<label for= "username" > Username:</label> in<input type= "text" id= "username" class= "required"/> the</div> the<div class= "int" > About<label for= "email" > Email:</label> the<input type= "text" id= "email" class= "required"/> the</div> the<div class= "int" > +<label for= "Personinfo" > Profile:</label> -<input type= "text" id= "Personinfo"/> the</div>Bayi<div class= "Sub" > the<input type= "Submit" value= "commit" id= "send"/><input type= "reset" id= "res"/> the</div> -</form> - the</body> thejquery form Validation