Powered by InterCreatives | Site Map
Search:
NewSourceMedia Popular Tutorials: PHP Javascripts Web Hosting
SoftwareTutorials
CATEGORIES
Job Listings
 
Home / Javascripts / Forms

Javascript Email Validation Form

Published by: Alexander McLean III


The function below checks if the content has the general syntax of an email.

This means that the input data must contain at least an @ sign and a dot (.). Also, the @ must not be the first character of the email address, and the last dot must at least be one character after the @ sign:

<script language="Javascript">
function checksubmit()
{
apos=document.add_data.email.value.indexOf("@")
dotpos=document.add_data.email.value.lastIndexOf(".")
if (document.add_data.email.value == "" || apos<1 || dotpos-apos<2)
{
alert("Please fix: email")
document.add_data.email.focus()
return false
}
return true
}
</script>

The entire script, with the HTML code form is located here. You can download the file and edit it as you please.
Try the code here.


Next Javascripts Page:
1  2  3  4  5  6  7  8  [9]  10  11  12 





Hosting by iPowerWeb.com - 50 Gb for $7.95