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

  CLONNEN 19:09 07 Jun 2006
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 2006

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

Elsewhere on IDG sites

Best Black Friday Deals 2017

Black Friday Deals for Designers & Artists: Adobe, Apple, Corel Painter, Microsoft Surface, Wacom &e…

Best Black Friday Apple Deals 2017

Black Friday 2017 : date, sites participants & bonnes affaires