SHARE
TWEET

validation

rahul244698 Mar 8th, 2013 226 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function validateForm()
  2. {
  3. var x=document.forms["myForm"]["email"].value;
  4. var atpos=x.indexOf("@");
  5. var dotpos=x.lastIndexOf(".");
  6. if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
  7.   {
  8.   alert("Not a valid e-mail address");
  9.   return false;
  10.   }
  11. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top