I've tried to get my drop-down menu to validate every which way, but no luck. Can someone take a look at my code and see what I need to do?
<CodeStart>
<html>
<head>
<script type="text/javascript">
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
{alert(alerttxt);return false}
else {return true}
}
}function validate_form(thisform)
{
with (thisform)
{
if (validate_required(name,"Name must be filled out!")==false)
{name.focus();return false}
if (validate_required(company,"Company must be filled out!")==false)
{company.focus();return false}
if (validate_required(address,"Address must be filled out!")==false)
{address.focus();return false}
if (validate_required(phone,"Phone must be filled out!")==false)
{phone.focus();return false}
if (validate_required(email,"Email must be filled out!")==false)
{email.focus();return false}
}
}
function msg(obj) {
if (obj.selectedIndex == 1) {
alert("Please select a system!");
}
}
</script>
</head><body>
<table width="550">
<form action="send.asp" name = ContactUs
onsubmit="return validate_form(this)"
method="post">
<TR><TD width="150" align="right">
<font face="Verdana" size="2">Name:
</font>
</TD><TD colspan="2">
<input type="text" name="name" size="30"></TD></TR>
<TR><TD width="150" align="right">
<font face="Verdana" size="2">Company:
</font>
</TD><TD colspan="2">
<input type="text" name="company" size="30"></TD></TR>
<TR><TD width="150" align="right">
<font face="Verdana" size="2">Address:
</font>
</TD><TD colspan="2">
<input type="text" name="address" size="30"></TD></TR>
<TR><TD width="150" align="right">
<font face="Verdana" size="2">Phone:
</font>
</TD><TD colspan="2">
<input type="text" name="phone" size="30"></TD></TR>
<TR><TD width="150" align="right">
<font face="Verdana" size="2">Fax:
</font>
</TD><TD colspan="2">
<input type="text" name="fax" size="30"></TD></TR>
<TR><TD width="150" align="right">
<font face="Verdana" size="2">Email:
</font>
</TD><TD colspan="2">
<input type="text" name="email" size="30"></TD></TR>
<TR><TD width="150" align="right">
<font face="Verdana" size="2">Systems:
</font>
</TD><TD colspan="2">
<select size="1" type=select-one name="systems">
<option value="Not selected" selected>Please Select</option>
<option value="value 1">AS 350 IBF (STC pending)</option>
<option value="value 2">AGUSTA A119 IBF (STC pending)</option>
<option value="value 3">AH-64A APU IBF</option>
<option value="value 4">Bell 205/210 (STC pending)</option>
<option value="value 5">Bell 206L-1/C30 IBF (STC approved)</option>
<option value="value 6">Bell 206L-3/4 IBF (STC approved)</option>
<option value="value 7">Bell 206B/OH-58A/C IBF (STC approved)</option>
<option value="value 8">Bell 407 IBF (STC approved)</option>
<option value="value 9">CH-47 APU IBF</option>
<option value="value 10">OH-58D EBF</option>
<option value="value 11">MD 500 IBF (STC approved)</option>
<option value="value 12">UH-60 EIBF</option>
<option value="value 13">UH-60 APU IBF</option>
<option value="value 14">UH-1H IBF (STC pending - available for freedom of use)</option>
<option value="value 15">OTHER</option>
<option value="value 16">Spare Parts</option>
</select></TD></TR>
<TR><TD width="150" align="right">
<font face="Verdana" size="2">General Comments: </font> </TD><TD colspan="2">
<textarea rows="5" name="Comments" cols="30"></textarea></TD></TR>
<TR><TD width="150">
</TD><TD colspan="2">
</TD></TR>
<TR><TD width="150">
</TD><TD width="67">
<p>
<input type="submit" value="Submit" style="float: right"></TD><TD width="324">
<INPUT type=reset value=" Reset "></TD></TR>
</form></table>
</body></html>
</CodeEnd>
<CodeStart>
<html>
<head>
<script type="text/javascript">
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
{alert(alerttxt);return false}
else {return true}
}
}function validate_form(thisform)
{
with (thisform)
{
if (validate_required(name,"Name must be filled out!")==false)
{name.focus();return false}
if (validate_required(company,"Company must be filled out!")==false)
{company.focus();return false}
if (validate_required(address,"Address must be filled out!")==false)
{address.focus();return false}
if (validate_required(phone,"Phone must be filled out!")==false)
{phone.focus();return false}
if (validate_required(email,"Email must be filled out!")==false)
{email.focus();return false}
}
}
function msg(obj) {
if (obj.selectedIndex == 1) {
alert("Please select a system!");
}
}
</script>
</head><body>
<table width="550">
<form action="send.asp" name = ContactUs
onsubmit="return validate_form(this)"
method="post">
<TR><TD width="150" align="right">
<font face="Verdana" size="2">Name:
</font>
</TD><TD colspan="2">
<input type="text" name="name" size="30"></TD></TR>
<TR><TD width="150" align="right">
<font face="Verdana" size="2">Company:
</font>
</TD><TD colspan="2">
<input type="text" name="company" size="30"></TD></TR>
<TR><TD width="150" align="right">
<font face="Verdana" size="2">Address:
</font>
</TD><TD colspan="2">
<input type="text" name="address" size="30"></TD></TR>
<TR><TD width="150" align="right">
<font face="Verdana" size="2">Phone:
</font>
</TD><TD colspan="2">
<input type="text" name="phone" size="30"></TD></TR>
<TR><TD width="150" align="right">
<font face="Verdana" size="2">Fax:
</font>
</TD><TD colspan="2">
<input type="text" name="fax" size="30"></TD></TR>
<TR><TD width="150" align="right">
<font face="Verdana" size="2">Email:
</font>
</TD><TD colspan="2">
<input type="text" name="email" size="30"></TD></TR>
<TR><TD width="150" align="right">
<font face="Verdana" size="2">Systems:
</font>
</TD><TD colspan="2">
<select size="1" type=select-one name="systems">
<option value="Not selected" selected>Please Select</option>
<option value="value 1">AS 350 IBF (STC pending)</option>
<option value="value 2">AGUSTA A119 IBF (STC pending)</option>
<option value="value 3">AH-64A APU IBF</option>
<option value="value 4">Bell 205/210 (STC pending)</option>
<option value="value 5">Bell 206L-1/C30 IBF (STC approved)</option>
<option value="value 6">Bell 206L-3/4 IBF (STC approved)</option>
<option value="value 7">Bell 206B/OH-58A/C IBF (STC approved)</option>
<option value="value 8">Bell 407 IBF (STC approved)</option>
<option value="value 9">CH-47 APU IBF</option>
<option value="value 10">OH-58D EBF</option>
<option value="value 11">MD 500 IBF (STC approved)</option>
<option value="value 12">UH-60 EIBF</option>
<option value="value 13">UH-60 APU IBF</option>
<option value="value 14">UH-1H IBF (STC pending - available for freedom of use)</option>
<option value="value 15">OTHER</option>
<option value="value 16">Spare Parts</option>
</select></TD></TR>
<TR><TD width="150" align="right">
<font face="Verdana" size="2">General Comments: </font> </TD><TD colspan="2">
<textarea rows="5" name="Comments" cols="30"></textarea></TD></TR>
<TR><TD width="150">
</TD><TD colspan="2">
</TD></TR>
<TR><TD width="150">
</TD><TD width="67">
<p>
<input type="submit" value="Submit" style="float: right"></TD><TD width="324">
<INPUT type=reset value=" Reset "></TD></TR>
</form></table>
</body></html>
</CodeEnd>