sidorak95
12-29-2007, 07:18 PM
Am I doing something wrong with this page? When I click the Submit button, it's supposed to validate.
www.fungamesuniverse.com/form1.htm
<html>
<head>
<script type="text/javascript">
function validate_email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
if (apos<1||dotpos-apos<2)
{alert(alerttxt);return false;}
else {return true;}
}
}
function validate_form(thisform)
{
with (thisform)
{
if (validate_email(email,"Not a valid e-mail address!")==false)
{email.focus();return false;}
}
}
</script>
</head>
<body>
<form action="submitpage.htm"
onsubmit="return validate_form(this);"
method="post">
<p align="center">
<img border="0" src="Logo_Design.JPG" width="864" height="207">
<form action="submitpage.htm"
onsubmit="return validate_form(this);"
method="post">
<p align="center">Name: </p>
<p align="center"><input type="text" name="T1" size="20"></p>
<p align="center">
Email:
</p>
<p align="center">
<input type="text" name="email" size="20">
</p>
<p align="center">
Purpose Of Site:
</p>
<p align="center">
<input type="text" name="T2" size="20">
</p>
<p align="center">
Describe The Look:
</p>
<p align="center">
<textarea rows="2" name="S1" cols="20"></textarea>
</p>
</form>
<p align="center"><input type="submit" value="Submit">
</body>
</html>
www.fungamesuniverse.com/form1.htm
<html>
<head>
<script type="text/javascript">
function validate_email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
if (apos<1||dotpos-apos<2)
{alert(alerttxt);return false;}
else {return true;}
}
}
function validate_form(thisform)
{
with (thisform)
{
if (validate_email(email,"Not a valid e-mail address!")==false)
{email.focus();return false;}
}
}
</script>
</head>
<body>
<form action="submitpage.htm"
onsubmit="return validate_form(this);"
method="post">
<p align="center">
<img border="0" src="Logo_Design.JPG" width="864" height="207">
<form action="submitpage.htm"
onsubmit="return validate_form(this);"
method="post">
<p align="center">Name: </p>
<p align="center"><input type="text" name="T1" size="20"></p>
<p align="center">
Email:
</p>
<p align="center">
<input type="text" name="email" size="20">
</p>
<p align="center">
Purpose Of Site:
</p>
<p align="center">
<input type="text" name="T2" size="20">
</p>
<p align="center">
Describe The Look:
</p>
<p align="center">
<textarea rows="2" name="S1" cols="20"></textarea>
</p>
</form>
<p align="center"><input type="submit" value="Submit">
</body>
</html>