Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Remove option from DropDown depending on CheckBox

Avatar

Level 3

Hello again!

I want to know if is possible to remove/add or show/not show an option from a dropdown menu depending on a checkbox selection.

Thanks!

03-abr-13 13-15-55.png

03-abr-13 13-16-07.png

1 Accepted Solution

Avatar

Correct answer by
Level 5

You can remove the option from the drop downlist based on the selection of other dropdown.

http://forums.adobe.com/message/2807305#2807305

This post would help but you need to do some scripting for your need.

Thanks

Vjay

View solution in original post

2 Replies

Avatar

Correct answer by
Level 5

You can remove the option from the drop downlist based on the selection of other dropdown.

http://forums.adobe.com/message/2807305#2807305

This post would help but you need to do some scripting for your need.

Thanks

Vjay

Avatar

Level 3

Thanks! I marked the answer as correct but the thing is that I managed to delete on item and to add an item BUT is no exactly what I need.

I need to be able to delete/hide and /add/show THE SAME ITEM, or that it look like the same item, please see the example of what I´m getting:

When you open the document:

01.png

If you click "yes" in the first radio, value 4 is added

02.png

If you click "yes" in the second radio, value 5 is added

03.png

If you click "no" on the first radio, you remove value 4 BECAUSE you are removing the item #3

04.png

If you click "no" on the second radio, you remove nothing 4 BECAUSE you are trying to remove item #4


05.png

And then you get this weird combinations

06.png

This is the code on the first Radio

form1.#subform[0].value_4::click - (JavaScript, client)

if (this.rawValue == "1") {

          DropDownList1.addItem("value 4");

}else {

          DropDownList1.deleteItem(3);

}

This is the code on the second radio

form1.#subform[0].value_5::click - (JavaScript, client)

if (this.rawValue == "1") {

          DropDownList1.addItem("value 5");

}else {

          DropDownList1.deleteItem(4);

}

Does anyone know how to delete a specific item from a dropdrown? or maybe not delete it, just hide if this is possible... I tried editing specific values to add/delete always the same item but it didnt work.

Thanks!