Hi, I have designed a page through which a user will be able send it's comment to me. It has few fields that i want to validate. Can someone check my coding and tell me what's wrong with it. I need it really fast. THANK YOU.
<HTML>
<HEAD>
<!--Hide javascript from browser-->
<SCRIPT LANGUAGE="JavaScript">
function checkEmail()
{
Var userName = document.frmcontact.textfield1.value;
var userEmail = document.frmcontact.textfield2.value;
var userComment = document.frmcontact.textfield3.value;
if (userName == ""
{
alert("Please fill in the text box"
;
document.frmcontact.textfield1.focus();
return false;
}
if (userEmail == ""
{
alert("Please fill in the text box"
;
document.frmcontact.textfield2.focus();
return false;
} else if (userEmail.indexOf("@"
==-1 || userEmail.indexOf(" "
!=-1) {
alert("Sorry, your e-mail address is invalid"
;
document.subscribe.email.focus();
return false;
}
if (userComment == ""
{
alert("Please enter your suggestions, comments or questionns. Thank you!"
;
document.frmcontact.textfield3.focus();
return false;
}
}
</SCRIPT>
<TITLE>contactus</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>
<BODY BGCOLOR="#FFFFCC" onLoad="initVars()">
<TABLE WIDTH="75%" BORDER="1" HEIGHT="590"><TR><TD HEIGHT="104"> </TD></TR><TR><TD HEIGHT="638"><DIV ID="Layer2" STYLE="position:absolute; width:153px; height:60px; z-index:2; left: 30px; top: 26px"><IMG SRC="Image/logo.gif" WIDTH="152" HEIGHT="85"></DIV><DIV ID="Layer14" STYLE="position:absolute; width:200px; height:49px; z-index:6; left: 188px; top: 45px"><DIV ALIGN="CENTER"><B><FONT SIZE="6" COLOR="#FFFF99">Contact
Us! </FONT></B></DIV></DIV><FORM action=" method="POST" NAME="frmcontact" onSubmit="return checkEmail();">
<INPUT TYPE="hidden" NAME="your_email_address" VALUE="ammara_masood@hotmail.com">
<INPUT TYPE="hidden" NAME="your_name" VALUE="KIdz Own Club"> <INPUT TYPE="hidden" NAME="email_subject_line" VALUE="Contact Us">
<INPUT TYPE="hidden" NAME="required_fields" VALUE="your_email_address"> <INPUT TYPE="hidden" NAME="thank_you_title" VALUE="Thank you for completing the form! We will get back to you as soon as possible. ">
<INPUT TYPE="hidden" NAME="return_link_url" VALUE="<INPUT TYPE="hidden" NAME="return_link_name" VALUE="Homepage"> <INPUT TYPE="hidden" NAME="background_color" VALUE="#FFFFFF">
<INPUT TYPE="hidden" NAME="text_color" VALUE="#FF0000"> <INPUT TYPE="hidden" NAME="link_color" VALUE="#008000">
<INPUT TYPE="hidden" NAME="visited_link_color" VALUE="#FF0000"> <INPUT TYPE="hidden" NAME="active_link_color" VALUE="#008000"><P> </P><P> </P><DIV ID="Layer3" STYLE="position:absolute; width:593px; height:32px; z-index:3; left: 19px; top: 159px"><FONT COLOR="#FF0000">Send
us your comments or suggestions about the website. Your comments will be appreciated.
</FONT><DIV ID="Layer4" STYLE="position:absolute; width:71px; height:34px; z-index:4; left: 111px; top: 46px"><FONT COLOR="#FF0000">Nam</FONT><DIV ID="Layer9" STYLE="position:absolute; width:200px; height:35px; z-index:5; left: 73px; top: 39px"><SELECT NAME="select1"><OPTION>Suggestion</OPTION><OPTION>Comment</OPTION><OPTION>Questionn</OPTION></SELECT></DIV><DIV ID="Layer10" STYLE="position:absolute; width:200px; height:29px; z-index:7; left: 73px; top: 77px"><INPUT TYPE="text" NAME="textfield2"><DIV ID="Layer11" STYLE="position:absolute; width:200px; height:115px; z-index:1; left: 2px; top: 31px"><TEXTAREA NAME="textfield3" ROWS="10" COLS="40"></TEXTAREA><DIV ID="Layer12" STYLE="position:absolute; width:200px; height:40px; z-index:1; left: 2px; top: 194px"><INPUT TYPE="submit" NAME="Submit"
VALUE="Submit"><INPUT TYPE="reset" VALUE="Reset" NAME="Reset"></DIV></DIV></DIV><FONT COLOR="#FF0000">e:</FONT>
<DIV ID="Layer5" STYLE="position:absolute; width:74px; height:35px; z-index:4; left: -3px; top: 38px"><FONT COLOR="#FF0000">This
is a:</FONT></DIV><DIV ID="Layer6" STYLE="position:absolute; width:171px; height:29px; z-index:5; left: -99px; top: 78px"><FONT COLOR="#FF0000">E-mail
Address (Required):</FONT></DIV><DIV ID="Layer7" STYLE="position:absolute; width:160px; height:31px; z-index:6; left: -88px; top: 114px"><FONT COLOR="#FF0000">Suggestion
or a comment: </FONT></DIV></DIV><FONT COLOR="#FF0000"> </FONT></DIV><P> </P><P> </P><P> </P><DIV ID="Layer8" STYLE="position:absolute; width:200px; height:39px; z-index:4; left: 202px; top: 204px"><INPUT TYPE="text" NAME="textfield1"></DIV><P> </P><P> </P><P> </P><P> </P><DIV ID="Layer13" STYLE="position:absolute; width:71px; height:45px; z-index:5; left: 671px; top: 538px; background-color: #FFFFFF; layer-background-color: #FFFFFF; border: 1px none #000000"><A HREF="Homepage.htm"><IMG SRC="Image/home.gif" WIDTH="69" HEIGHT="66" BORDER="0"></A></DIV><P> </P><P> </P><P> <BLOCKQUOTE><P> </P></BLOCKQUOTE></FORM></TD></TR></TABLE><DIV ID="Layer1" STYLE="position:absolute; width:730px; height:103px; z-index:1; left: 15px; top: 18px; background-color: #FFFFCC; layer-background-color: #FFFFCC; border: 1px none #000000"><IMG SRC="Image/titlebar.gif" WIDTH="737" HEIGHT="102"></DIV>
</BODY>
</HTML>
<HTML>
<HEAD>
<!--Hide javascript from browser-->
<SCRIPT LANGUAGE="JavaScript">
function checkEmail()
{
Var userName = document.frmcontact.textfield1.value;
var userEmail = document.frmcontact.textfield2.value;
var userComment = document.frmcontact.textfield3.value;
if (userName == ""
{
alert("Please fill in the text box"
document.frmcontact.textfield1.focus();
return false;
}
if (userEmail == ""
{
alert("Please fill in the text box"
document.frmcontact.textfield2.focus();
return false;
} else if (userEmail.indexOf("@"
alert("Sorry, your e-mail address is invalid"
document.subscribe.email.focus();
return false;
}
if (userComment == ""
{
alert("Please enter your suggestions, comments or questionns. Thank you!"
document.frmcontact.textfield3.focus();
return false;
}
}
</SCRIPT>
<TITLE>contactus</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>
<BODY BGCOLOR="#FFFFCC" onLoad="initVars()">
<TABLE WIDTH="75%" BORDER="1" HEIGHT="590"><TR><TD HEIGHT="104"> </TD></TR><TR><TD HEIGHT="638"><DIV ID="Layer2" STYLE="position:absolute; width:153px; height:60px; z-index:2; left: 30px; top: 26px"><IMG SRC="Image/logo.gif" WIDTH="152" HEIGHT="85"></DIV><DIV ID="Layer14" STYLE="position:absolute; width:200px; height:49px; z-index:6; left: 188px; top: 45px"><DIV ALIGN="CENTER"><B><FONT SIZE="6" COLOR="#FFFF99">Contact
Us! </FONT></B></DIV></DIV><FORM action=" method="POST" NAME="frmcontact" onSubmit="return checkEmail();">
<INPUT TYPE="hidden" NAME="your_email_address" VALUE="ammara_masood@hotmail.com">
<INPUT TYPE="hidden" NAME="your_name" VALUE="KIdz Own Club"> <INPUT TYPE="hidden" NAME="email_subject_line" VALUE="Contact Us">
<INPUT TYPE="hidden" NAME="required_fields" VALUE="your_email_address"> <INPUT TYPE="hidden" NAME="thank_you_title" VALUE="Thank you for completing the form! We will get back to you as soon as possible. ">
<INPUT TYPE="hidden" NAME="return_link_url" VALUE="<INPUT TYPE="hidden" NAME="return_link_name" VALUE="Homepage"> <INPUT TYPE="hidden" NAME="background_color" VALUE="#FFFFFF">
<INPUT TYPE="hidden" NAME="text_color" VALUE="#FF0000"> <INPUT TYPE="hidden" NAME="link_color" VALUE="#008000">
<INPUT TYPE="hidden" NAME="visited_link_color" VALUE="#FF0000"> <INPUT TYPE="hidden" NAME="active_link_color" VALUE="#008000"><P> </P><P> </P><DIV ID="Layer3" STYLE="position:absolute; width:593px; height:32px; z-index:3; left: 19px; top: 159px"><FONT COLOR="#FF0000">Send
us your comments or suggestions about the website. Your comments will be appreciated.
</FONT><DIV ID="Layer4" STYLE="position:absolute; width:71px; height:34px; z-index:4; left: 111px; top: 46px"><FONT COLOR="#FF0000">Nam</FONT><DIV ID="Layer9" STYLE="position:absolute; width:200px; height:35px; z-index:5; left: 73px; top: 39px"><SELECT NAME="select1"><OPTION>Suggestion</OPTION><OPTION>Comment</OPTION><OPTION>Questionn</OPTION></SELECT></DIV><DIV ID="Layer10" STYLE="position:absolute; width:200px; height:29px; z-index:7; left: 73px; top: 77px"><INPUT TYPE="text" NAME="textfield2"><DIV ID="Layer11" STYLE="position:absolute; width:200px; height:115px; z-index:1; left: 2px; top: 31px"><TEXTAREA NAME="textfield3" ROWS="10" COLS="40"></TEXTAREA><DIV ID="Layer12" STYLE="position:absolute; width:200px; height:40px; z-index:1; left: 2px; top: 194px"><INPUT TYPE="submit" NAME="Submit"
VALUE="Submit"><INPUT TYPE="reset" VALUE="Reset" NAME="Reset"></DIV></DIV></DIV><FONT COLOR="#FF0000">e:</FONT>
<DIV ID="Layer5" STYLE="position:absolute; width:74px; height:35px; z-index:4; left: -3px; top: 38px"><FONT COLOR="#FF0000">This
is a:</FONT></DIV><DIV ID="Layer6" STYLE="position:absolute; width:171px; height:29px; z-index:5; left: -99px; top: 78px"><FONT COLOR="#FF0000">E-mail
Address (Required):</FONT></DIV><DIV ID="Layer7" STYLE="position:absolute; width:160px; height:31px; z-index:6; left: -88px; top: 114px"><FONT COLOR="#FF0000">Suggestion
or a comment: </FONT></DIV></DIV><FONT COLOR="#FF0000"> </FONT></DIV><P> </P><P> </P><P> </P><DIV ID="Layer8" STYLE="position:absolute; width:200px; height:39px; z-index:4; left: 202px; top: 204px"><INPUT TYPE="text" NAME="textfield1"></DIV><P> </P><P> </P><P> </P><P> </P><DIV ID="Layer13" STYLE="position:absolute; width:71px; height:45px; z-index:5; left: 671px; top: 538px; background-color: #FFFFFF; layer-background-color: #FFFFFF; border: 1px none #000000"><A HREF="Homepage.htm"><IMG SRC="Image/home.gif" WIDTH="69" HEIGHT="66" BORDER="0"></A></DIV><P> </P><P> </P><P> <BLOCKQUOTE><P> </P></BLOCKQUOTE></FORM></TD></TR></TABLE><DIV ID="Layer1" STYLE="position:absolute; width:730px; height:103px; z-index:1; left: 15px; top: 18px; background-color: #FFFFCC; layer-background-color: #FFFFCC; border: 1px none #000000"><IMG SRC="Image/titlebar.gif" WIDTH="737" HEIGHT="102"></DIV>
</BODY>
</HTML>