I think you must try "hidden" and not "invisible".
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.
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
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.
The hidden is a string so it must be in quotes...."hidden"
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.
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.
c) type: ObjectName.presence = "invisible";
3) Then choose the onclick event of your button and type: