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
BedrockMission!

Learn More

View all

Sign in to view all badges

Hiding and Showing Tables with Drop Down Menu

Avatar

Avatar
Level 1
3dMania
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
3dMania
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile
3dMania
Level 1

03-02-2017

Im trying to learn how to hide and unhide tables/subforms using the selection from a drop down menu. Here is the code I was using attached to the drop down menu which I pulled from a previous post...but when I open the PDF and make a selection in the drop down menu I get a validation error message:

The value you entered for Drop-down List is invalid.

If you click OK it still unhides the table you selected in drop down. How do you edit the following to stop the error messages from popping up when a user makes a selection.

Here is the code I was using:

form1.Test1.DropDownList1::validate - (JavaScript, client)

//Firsthideallfields

form1.Test1.YES.presence="hidden";

form1.Test1.NO.presence="hidden";

//Thentheifstatement

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

form1.Test1.YES.presence="visible";

}

else if(this.rawValue=="No"){

form1.Test1.NO.presence="visible";

}

Sample.PNG

The above image is a sample of what I have using Adobe LiveCycle to develop. I basically have a DropDownList which has the option Yes or No. And then I have 2 subForms

YES - Table and info needed

NO - Table and info needed

As I mentioned using the code provided in this earlier post I have this working but I just have an error message popping up.

**** We did find a solution but don't know if it will cause other problems later or why we were getting the error in the first place. Adding:

Adding:

this.disableAll;

At the end of the script....we don't get any error messages but again if anyone can explain why the messages were popping up to begin with that would be great.

Any help would be great.

Cheers,

D

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

07-02-2017

Hi,

use a script in the exit event instead of the validation event.

switch (this.rawValue) {

  case "Yes" :

  YES.presence = "visible";

  NO.presence = "hidden";

  break;

  case "No" :

  YES.presence = "hidden";

  NO.presence = "visible";

  break;

  default :

  YES.presence = "hidden";

  NO.presence = "hidden";

}

You also shoud set the presence of the subforms initially to hidden.