Expand my Community achievements bar.

Mask some entries in a drop down menu

Avatar

Former Community Member

Hi, it's me again :$

I would know if it's possible to mask some entries in a dropdown menu.

Here's an exemple

If I check Box 1 : I can see all the drop box menu and choose any items    

If I check Box 2 : I can choose only some items (and can't see other ones)

Check box 1 dropdownmenu :

  • Blue
  • Red
  • Green

Check box 2 dropdownmenu :

  • Blue
  • Pink
  • Purple
  • Red
  • Green

Thx

5 Replies

Avatar

Former Community Member

Hi,

You can have 2 dropdownmenu one over the other.

Say dropdownmenu 1 will be active always (visible) and make dropdownmenu 2 as inactive (invisible)

And based upon your check box selection make the dropdownmenu as visible/invisible.

For Check Box 1 - make dropdownmenu 1 visible and dropdownmenu 2 invisible

For Check Box 2 - make dropdownmenu 2 visible and dropdownmenu 1 invisible

Hope this will help.

Regards--

Chalukya.

Avatar

Former Community Member

keep the caption of dropdownmenu 1 and dropdownmenu 2 same, this seems to make the dropdownmenu as masked..

Avatar

Former Community Member

Thx, I've thinked about this solution but isn't possible in my case.

In fact if user A choose red, green or blue... User B does'nt need (and have to) choose other choice.

User B Only choose pink or purple if A can't make any choice.

Am I clear ??

I think the way could be something like if User A leave blank his drop down menu, show the dropdwon menu B.

But i'm neebie in javascript (or formcalc) and don't know how say it to designer.

Thanks

Nath

Avatar

Former Community Member

I've found answer by myself :

an if condition and it works.

Avatar

Level 7

Hi,

Acutaly the real solution is to use the preOpen event to fil the dropdown box. The event fires as the user clicks the dropdown but before the choices are shown.

So, when the user clicks, you run a script on preOpen that:

1. Clears the dropdown list // clearItems()

2. Tests the condition that determines the dropdown box choices //  if/then

3. Adds the items to the dropdown box // addItem()

I use this startegy frequently. The preOpen event on dropdowns is powerful.

Good luck!

Stephen