Hi

I want to validate a form to make sure all field are entered before
submission and I understand javascript is best way to do this.

I have discovered how to do this for text input fields, but I need to
have validation on drop down list, so at the top of my list I can have
the option "select one" which is not able to be submitted.

This is the code I have that I thought would have made it work. Any
suggestions on what I have not done and what I could do to get it to
work.

Thanks

<SCRIPT LANGUAGE="JavaScript">
<!-- Hide code from non-js browsers
function validateForm()
{
formObj = document.sample;
if ((formObj.place1text.value == "") ||
(formObj.place2text.value == "") ||
(formObj.day.value == ""))
{
alert("You have not filled in all the
fields.");
return false;
}
else
return true;
}
// end hiding -->
</SCRIPT>

And parts of the HTML code

<FORM ACTION="database51.php" NAME="sample" METHOD="POST"
onSubmit="return validateForm()">

<P>From:
<SELECT NAME="place1text">
<OPTION SELECTED VALUE="1">Select One
<OPTION VALUE="">---------
<?php
while ($places = mysql_fetch_array($place1)) {
$place1text = $places["Place"];
echo("<OPTION VALUE='$place1text'>$place1text\n");
}
?>
</SELECT></P>

<P>To:
<SELECT NAME="place2text">
<OPTION SELECTED VALUE="">Select One
<OPTION VALUE="">---------
<?php
while ($places = mysql_fetch_array($place2)) {
$place2text = $places["Place"];
echo("<OPTION VALUE='$place2text'>$place2text\n");
}
?>
</SELECT></P>
<P>Day:
<SELECT NAME="day">
<OPTION SELECTED VALUE="">Select One
<OPTION VALUE="">---------
<OPTION VALUE='Monday'>Monday
<OPTION VALUE="Tuesday">Tuesday
<OPTION VALUE="Wednesday">Wednesday
<OPTION VALUE="Thursday">Thursday
<OPTION VALUE="Friday">Friday
<OPTION VALUE="Saturday">Saturday
<OPTION VALUE="Sunday">Sunday
</SELECT>
</FORM>

Thanks