HTML web form - make 2nd menu reliant on 1st

  CLONNEN 19:09 07 Jun 06
Locked

In part of my web form I need to have one menu selection display an alternative list of choices based on an earlier menu selection within the same form.

I want the User to be able to choose a Day of the week in the first menu selection. The HTML code I have for this is :

P>Select a Day:
SELECT NAME="day" STYLE="width: 3.28cm; height: 0.58cm">
OPTION SELECTED>Monday
OPTION>Tuesday
OPTION>Wednesday
OPTION>Thursday
OPTION>Friday
OPTION>Saturday
OPTION>Sunday /OPTION>
/SELECT> /P>

Next I want the User to choose a Time. If it is a weekday (Monday-Friday) I want the following menu to appear :

P>Select a Time:
SELECT NAME="time1" STYLE="width: 3.28cm; height: 0.58cm">
OPTION SELECTED>18:00
OPTION>19:00
OPTION>20:00
OPTION>21:00 /OPTION>
/SELECT> /P>

If however the User chose a Weekend day (Sat/Sun) then I wish the options to be :

P>Select a Time:
SELECT NAME="time2" STYLE="width: 3.28cm; height: 0.58cm">
OPTION SELECTED>9:00
OPTION>10:00
OPTION>11:00
OPTION>12:00
OPTION>13:00
OPTION>14:00
OPTION>15:00
OPTION>16:00
OPTION>17:00
OPTION>18:00
OPTION>19:00
OPTION>20:00
OPTION>21:00 /OPTION>
/SELECT> /P>

Any ideas on how I can achieve the effect I want? Do I need to use Javascript code or is there some sort of IF statement I can use?

  harristweed 17:25 08 Jun 06

This thread is now locked and can not be replied to.

How to get Windows 10 for free | How to install Windows 10: There is still a way to avoid paying…

1995-2015: How technology has changed the world in 20 years

Alex Chinneck’s giant ice cube Christmas tree at Kings Cross

Apple rumours & predictions 2017: The iPhone 8, new iPads, and everything else you should expect fr7…