HTML Multiple selects

Soldato
Joined
31 May 2006
Posts
4,239
Location
127.0.0.1
Hi all

What i'm after is probably some javascript to do the following:

Select one will have for example:

Fruit
Veg
Meat

And if you choose Fruit a second select next to it (on the same page that requires no reloading or POST of the same page - popup might be ok) will be populated with Apple, Orange etc... and if you choose Veg it says Potato, Carrot etc..

Thanks in advance
 
Personally I'd use a JavaScript even to trigger a change in the "display" CSS attribute for the next select box, and do it that way :).
 
have 1 select for each of your child types and set it to disabled so that it doesn't post if the user submits the form, then as Makhaira says, just display and enable the form using javascript onchange
 
I'm not sure I understand what you are after anymore? If you were to create the second list with a default value, and then check on submit that it was different to the default value, would that not serve your purpose? Apologies if I'm being thick, but if that's not what you meant then I'm confused!
 
I'm not sure I understand what you are after anymore? If you were to create the second list with a default value, and then check on submit that it was different to the default value, would that not serve your purpose? Apologies if I'm being thick, but if that's not what you meant then I'm confused!

I don't want to submit the form until the WHOLE form is complete not just the selects. Otherwise I will have to update the resulting record in the database twice.
 
Back
Top Bottom