Homer_J
Homer_J

Reputation: 3323

dynamic drop down lists

SOLUTION: Remove option in select

I have a form where I would like users to rank their 'Top 3' from a list of 10 choices.

To validate responses I'd like a drop down next to each of the ten items. With the choices 1 to 3 - however, when a users selects '1' from anyone of the choices, all the drop downs get updated to show only options 2 and 3.

Similarly, when a users chooses option 3 for any one of the ten, the remaining drop downs are updated to only show option 2 and when that is selected all remaining drop downs are updated to show nothing or disabled.

I've used dynamic drop downs in the past via Javascript but not to this level of complexity - any thoughts or ideas, code examples or alternatives (Ajax etc.) welcomed!

Thanks,

H.

Upvotes: 0

Views: 258

Answers (1)

Sean
Sean

Reputation: 12433

Try - stackoverflow.com/questions/11071562/remove-option-in-select.

Also you could try radio groups-

<input type="radio" name="first" value="choice1">
<input type="radio" name="second" value="choice1">
<input type="radio" name="third" value="choice1">

<input type="radio" name="first" value="choice2">
<input type="radio" name="second" value="choice2">
<input type="radio" name="third" value="choice2">

....

Upvotes: 1

Related Questions