Java Script - validate Form Email with php
===========================
<head>
<script type="text/javascript">
function validateFormEmail()
{
var x=document.forms["quizForm"]["email_id"].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 id="form_406085" name="quizForm" class="appnitro" method="post" action="quiz_submit.php" onsubmit="return validateFormEmail();">
Email: <input type="text" name="email">
<input type="submit" value="Submit">
</form>
</body>
No comments:
Post a Comment