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.

Restrict choice within a drop down list

Avatar

Level 3

Is it possible to restrict the entries of a drop down list, by clicking a radio button?

What I am trying to achieve is:

Say my form has a drop down list, with six selections in the list;

Type A1

Type A2

Type A3

Type B1

Type B2

Type B3

Is it possible to click a radio button, and only "Type A1, Type A2, & Type A3" are displayed (or selectable)

Then if you were to click another radio button, only "Type B1, Type B2, & Type B3" are displayed (or selectable) within the same drop down list?

Is it possible to make items in a drop down list invisible, and then visible again if a radio button is clicked on?

Thanks in advance?

8 Replies

Avatar

Level 10

Display and hide the options is not available.. but you can store all the possible values in an array variable and add items based on the radio button value.. You will need to cal lthe clearItems method of the drop down before you add the new items.

Thanks

Srini

Avatar

Level 3

Thanks for the reply.

I am not really, fully understanding you?

I don't suppose you have an example of this method?

Avatar

Level 10

Here is a sample I got it from one of the forum that can help ..

https://acrobat.com/#d=4itq20dgIwKghjBO2nTxxg

In this sample, a global two - dimensional array variable was defined "countries" to hold the country name, Cities available and Streets available in each city.

By changing the selection in the Country dropdown it will change the list of items for State and then by changing the State it will change the available items in Street.

If in your case, you want only want to have one value, you can define the array as single dimensional.

Let me know if you need any help..

Thanks

Srini

Avatar

Level 3

Many Thanks!

I shall try this and let you know how I get on....

Avatar

Level 3

I am getting an error...file can not be found, or I dont have access to it, message and cant view the example?

Do you have another link?

Thanks

Avatar

Level 3

worked great. many thanks for your help.