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

Problem with subform (hidden & visible)

Avatar

20-01-2009

I am new to Javascript but feel embarrassed to ask since I have some programming background. Putting my pride behind me. I am trying to use a drop down list ("A" & "B") that will hide or make visible two subforms ("Subform1" and "Subform2"). This is pretty basic but I can not get it to work. Any suggestions?



if (this.rawValue == "A")

{

Subform1.presence = "visible";

Subform2.presence = "hidden";

}

else if (this.rawValue == "B")

{

Subform1.presence = "hidden";

Subform2.presence = "visible";

}

Replies

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

21-01-2009

The script looks OK ...what event do you have the code running on?



Also if you are using Acrobat to test with you can hit Ctrl-J and see the javascript console ..which will report any errors in your script when it runs.

Avatar

21-01-2009

Event:



form1.Page1.DropDownList1::exit - (JavaScript, client)



No errors in javascript console.

Avatar

Avatar
Boost 1
Level 4
Thomas_McConnac
Level 4

Likes

2 likes

Total Posts

134 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 4
Thomas_McConnac
Level 4

Likes

2 likes

Total Posts

134 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile
Thomas_McConnac
Level 4

22-01-2009

Add the line



console.println ("" +this.rawValue);



Just before your presence changing code, just to check what value it is set to when you are running it. It might not have changed at the time you are running the code.



Tom

Avatar

23-01-2009

Thomas adding code did not fix problem. I would love to send pdf to someone to figure out what's going on. Any takers?????

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

23-01-2009

Send it to livecycle8@gmail.com and I will have a look.

Avatar

23-01-2009

As a general recommendation (since it's hard to debug in PDF), write code like this to trace the values before (or after) your code:



xfa.host.messageBox("RawValue: " + this.rawValue + "\nFormattedValue: " + this.formattedValue);

The messagebox will tell you if your values are what you expect them to be or not.

Avatar

26-01-2009

Problem solved by Paul. I did not save the form as a dynamic form. Thanks Paul. At least my code worked..... 😉