Expand my Community achievements bar.

SOLVED

Mutually Exclusive DropDowns

Avatar

Level 2

Hi, All:

I am working on a form in which I need to have a user rate four items from 1-4 in comparison to each other. Initially we were going to use 4 drop downs each drop down containing the four options allowing the user to choose. The problem is, of course, that the user could choose option 1 four times in a row. So I need some way to allow the user to rate these four items from 1 - 4 but in a mutually exclusive manner. the image below shows the problem (they're in spanish but the text isn't important). Here item 1 and item 4 were both selected as 1 which is what we want to prevent. Any suggestions would be greatly appreciated. Thanks.

4choices.png

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

You could have a script in the preOpen event of all of the four dropdowns that would set the display items, depending on the previous selections in the other dropdowns.

There is an example here for populating dropdowns: http://assure.ly/jcTahK.

Give this a try in the preOpen event of DropDownList1:

// Remove items previously selected

this.deleteItem(DropDownList2.selectedIndex);

this.deleteItem(DropDownList3.selectedIndex);

this.deleteItem(DropDownList4.selectedIndex);

Hope that helps,

Niall

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi,

You could have a script in the preOpen event of all of the four dropdowns that would set the display items, depending on the previous selections in the other dropdowns.

There is an example here for populating dropdowns: http://assure.ly/jcTahK.

Give this a try in the preOpen event of DropDownList1:

// Remove items previously selected

this.deleteItem(DropDownList2.selectedIndex);

this.deleteItem(DropDownList3.selectedIndex);

this.deleteItem(DropDownList4.selectedIndex);

Hope that helps,

Niall

Avatar

Level 2

Thank you, Niall. I used the link your post and downloaded the document located there. I was able to use the scripting in that email to create similar scripts in my document and problem solved. This was a big help. Thanks again.