I have the following code. What I want it to be able to do is when the user clicks on an item once in the drop down box to change another drop down boxes contents. So if the option value is 0 then display one set of times if not display another set of times. Do I need a javascript function, if so does anyone know one???
The Code:
<?
echo '<form name="days" method="post" action="test2.php">';
echo '<select name="Day">';
$index = date("w");
$theDay ="";
$i = $index;
while ($i <= 6)
{
?>
<option value= <?=$i?>>
<?
switch($i) {
case 0:
$theDay = "Sunday";
break;
case 1:
$theDay = "Monday";
break;
case 2:
$theDay = "Tuesday";
break;
case 3:
$theDay = "Wednesday";
break;
case 4:
$theDay = "Thursday";
break;
case 5:
$theDay = "Friday";
break;
case 6:
$theDay = "Saturday";
break;
}
echo $theDay;
$i++;
if ($i >= 7)
$i = 0;
if ($i == $index){
break;
exit;
}
}
echo "</select>";
echo '<input type="Submit" value="Select Day" name="Submit">';
echo "</form>";
?>