Hide/Show Presence setting

Avatar

09-07-2008

I am attempting to use javascript to hide/show items when I button is pressed. If the items are set to visible in the design view the script to hide/show works fine, but if I set the presence property to invisible or hidden from design view, the script will not override that and make the items visible. Has anyone come across this before? Below is a copy of the script I've been using.



Replies

Avatar

Avatar
Level 5
_jerome_dinnat_
Level 5

Likes

0 likes

Total Posts

180 posts

Correct reply

0 solutions
View profile

Avatar
Level 5
_jerome_dinnat_
Level 5

Likes

0 likes

Total Posts

180 posts

Correct reply

0 solutions
View profile
_jerome_dinnat_
Level 5

09-07-2008

Hi,



I think you must try "hidden" and not "invisible".

Avatar

09-07-2008

I have tried both Hidden and Invisible from design view and both cause the script not to function. If the presence is set to visible from the design view both "hidden" and "invisible" work fine in the script.

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

10-07-2008

Both hidden and invisible are valid values. Invisible will leave the object on the form (just make it invisible to the user). Hidden will remove it from th elayout so no reference to the object is available.



I think your issue is that you are not displaying the form as a dynamic form. If you are using Preview to test the form, go under File/Form Properties and click on the preview tab. Make suer the form is set as an Interactive form and the Preview Adobe XML Form as is set to Dynamic XML Form

Avatar

15-07-2008

Thanks for the suggestions, still no luck though, I am trying to use the feature to swap two subforms on a page so that when a button is pressed one subform becomes hidden and the other form becomes visible. I have verified that the form is saved as a dynamic form.



Ive tried page1.presence = hidden, form1.page1.presence = hidden, and this.presence = hidden.



Any ideas?

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

15-07-2008

The hidden is a string so it must be in quotes...."hidden"

Avatar

16-07-2008

Sorry, poor typing on my part. I think i figured it out though, i had the button to switch forms on one of the subforms. When i moved the button off the subform and on to the main form it seems to be working now.



Thanks for all the help.

Avatar

18-07-2008

Paul,



Are you using LiveCycle Designer?



If yes, do the following:



1) Save you work as "Adobe Dynamic XML Form".

2) On each of the buttons, do the following:

a) Select the button.

b) Choose "Initialize" in the scripting toolbar. Choose language as "JavaScript".

c) type: ObjectName.presence = "invisible";

3) Then choose the onclick event of your button and type:

ObjectName.presence = "invisible";

or ObjectName.presence = "visible";

depending on your requirement.



Hope it helps 🙂