views:

150

answers:

3

I want to implement chained select boxes: the first select box determines the values in the second select box. I want this to work in plain HTML first, and add Javascript later.

Should I have both select boxes in one form tag, or have two seperate forms on one page, each with a select box?

A: 

whatever is more convenient for you. Not realy software related

Grumpy
A: 

One form (at least on the initial page).

Either:

  • with only one select by default (which is submitted to the server, which returns a new form with a hidden input replacing the first select and a second select chosen based on the option selected) progressively enhanced to generate new selects when options are picked.
  • with all the selects in the form, with instructions about which one users should use based on their first answer, progressively enhanced with JS to hide them all (except the first) and then reveal them based on the options picked.
David Dorward
+2  A: 

If you want to send and retrieve all selected values at once, put them in the same form. If you want to send and retrieve only one at once, put them in separate forms. Simple as that.

BalusC