Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Make subform visible by making a selection in a dropdown

donn44157260
Level 5
Level 5

I am trying to make a subform visible if the user select yes from a dropdown.

I have the following setup on the form

Subfom1 -Dropdown with 3 entries, Select, No Yes.

Subform2 – Text field for users to enter test

The code I have been trying to use is

execEvent("change"); In the Initialize event and in the change event I was using

if (xfa.event.change == "5") {

    subform2.presence = "visible";

}

When I try the form, nothing happens,. There is no errors in the Javascript debugger

Any ideas would be helpful.

I am running Adobe LiveCycle Designer 8.05.2073.1.374024

Any ideas would be helpful

Chomp

0 Replies
Magus069
Level 10
Level 10

If your default value is set to select you can write in the change event

if (this.rawValue == 5)

donn44157260
Level 5
Level 5

Thanks Robert;

I did as you suggested and I still cannot get the field to become visible. I tried a couple of things.

(1) In the Initialize Event - execEvent("change");

In the Change Event - if (this.rawValue == "1") {

why_subform.presence = "visible";

}

The subform did not become visible nor was there an error in the javascript debugger

(2) Took execEvent("change"); out of the Initialize Event.

In the Change Event - if (this.rawValue == "1") {

why_subform.presence = "visible";

}

The subform did not become visible nor was there an error in the javascript debugger

Initialize Event blank

Added to the Change Event

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

    why_subform.presence = "hidden";

}

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

    why_subform.presence = "visible";

}

The subform did not become visible nor was there an error in the javascript debugger

(3) Added execEvent("change"); to the Initialize Event

The subform did not become visible nor was there an error in the javascript debugger

Preference defaults are set to – Preview = Interactive Form

                                                 XDP Preview Format – Adobe 8 (Dynamic) XML Form

Magus069
Level 10
Level 10

if you have specified values in your dropdownlist,

i think you have to check if the value is 1 as an integer not a string