Here is my code so far...These are the select menus in the form. Basically what I want is this...the user selects the course menu and based on their selection the date menu is automatically filled with the date linked to the course selection.
Make sense?
<label for="course2">Course:</label>
<select name="course">
<option value="none" onchange="optChange()">Select Course</option>
<?php
while ($row = mysql_fetch_array($result))
{
echo "<option value='" . $row["course_ID"] . "'>" . $row["course"] . "</option>";
}
?>
</select><br /><br />
<label for="date2">Date:</label>
<select name="date">
<option value="none">Select Date</option>
<?php
while ($row = mysql_fetch_array($result2))
{
echo '<option value="'.$row['date_ID'].'">' .$row['date']. '</option>';
}
?>
</select>
And here is my JavaScript so far...
<script language="JavaScript" type="text/javascript">
<!--
function optChange() {
document.form.date.selectedIndex = document.form.course.selectedIndex;
}
//-->
</script>
Why is it not working?
thanks,
Kevin.