Highlighted

Drop-down list logic conditional suppression of list items

SF111

11-07-2013

The Action Builder dialog box in Livecycle Designer ES2 Version 9.0 has some useful features.  Is it possible to do the following in the Action Builder dialog?

The form has three sequential Drop-down Lists.

The logic required is for the user to select a field on the first Drop-down List.  For example Size 12.

Based on option selected, (Size 12) in the first Drop-down List, the second Drop-down List must only show the colours available in Size 12.  In this case, the list items available could be Blue, Yellow and Green.

The user picks Yellow on the second Drop-down List and the only options available in the third Drop-down List would be Leather and Plastic, for example.

The list items in all the Drop-down Lists have other values beyond what is shown in the example above.  In other words, each subsequent Drop-down List need to suppress the list items based on what was selected from a Drop-down List before and so forth.

If it cannot be done easily in the Action Builder dialog box, can somebody point me in the direction where I can find an example script where that has been done before?

Replies

Highlighted

whyisthisme

11-07-2013

The code for something like this would be, in formcalc, in the preOpen event of the second box:

if (dropdownlist1 == 1) then

$.clearItems()

$.setItems("Blue,Yellow,Green")

elseif (dropdownlist1 == 2) then

$.clearItems()

$.setItems("Red,Yellow,Green")

endif

and then you would do the same for the third one referencing the second one. Just make sure in the boxes you have "specify item values' ticked under Object > Binding.

Highlighted

SF111

11-07-2013

Thank you whyisthisme.  That works fine.

However, I note in the LiveCycle Designer ES2 Scripting Basics Version 9 manual on page 40, that the preOpen event is not supported in an HTML browser.  That is a problem.

Is there something equivalent that would work in an HTML browser, like change event, click event, exit event etc.  What would be the code be?