Tuesday, October 21, 2014

E-mail textbox Validation in javascript

Posted by Gnani Palepu  |  No comments


 if you want more related search please click here  
 please help to other  
 http://scriptquery.blogspot.in/  

 <!DOCTYPE html>  
 <html>  
 <head>  
 <script>  
 function validateForm() {  
   var x = document.forms["myForm"]["email"].value;  
   var atpos = x.indexOf("@");  
   var dotpos = x.lastIndexOf(".");  
   if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) {  
     alert("Not a valid e-mail address");  
     return false;  
   }  
 }  
 </script>  
 </head>  
 <body>  
 <form name="myForm" action="demo_form.asp" onsubmit="return validateForm();" method="post">  
 Email: <input type="text" name="email">  
 <input type="submit" value="Submit">  
 </form>  
 </body>  
 </html>  

 if you want more related search please click here  
 please help to other  
 http://scriptquery.blogspot.in/  


3:38 AM Share:

0 comments:

Get updates in your email box
Complete the form below, and we'll send you the best coupons.

Deliver via FeedBurner
Proudly Powered by Blogger.
back to top