This content has been marked as final. Show 13 replies
I created a form that has a checkbox (default unchecked) and a button (default invisible) and added the following code to the "change" event on the checkbox:
if ( this.rawValue )
Button1.presence = "visible";
Button1.presence = "invisible";
When the box was checked, the button became visible. When unchecked, the button was invisible.
I'm stumped as to where this change event code is placed. I don't see anywhere to put it that makes sense. Should I work in the XML code? Currently I am working in LifeCycle Designer and I see only the options for code to go in the Object Palette as "import/export binding" but that doesn't seem right. Where does change event code go? Sorry for being so newbie.
View the following images for some help...
You need to expand the code portion of the interface if you haven't already done so, by clicking on the arrow (part circled in red) shown in the image.
When you have your object highlighted (in my example I dragged a button on, you should choose the checkbox on your form) choose "change" from the event dropdown.
I don't have that option that you have circled in red. Here is the screen print of my interface. http://karengrimm.com/ChangeEvent.jpg
It must be that you have to turn that option on somewhere?
OH! I found it! I had to go to "Windows" then "Script Editor" and now I have that arrow you circled.... YAY!
From the toolbar menu choose "Window > Script Editor".
I believe you can also turn it on with Ctrl+Shift+F5.
I got it! That was very helpful. http://michaelgrimmservices.com/employment_pub.pdf
Now I have the buttons turning on when the checkbox is clicked. Works GREAT.
Hmmm.... Well, the visible/invisible bit works great anyway. Any thoughts about why on some computers the email submit button works fine and sends out the filled in form but on other computers nothing happens at all? And I thought Acrobat Pro meant that users could save a copy of the form with all their responses in it on their desktop and attach it to their emails manually but my test computer doesn't permit the saving of the responses, only the raw form. Maybe another attribute I have to check somewhere along the way that I missed?
It depends on the program the user has. You can create a form with Acrobat Pro, but if a user only has Acrobat Reader then they can't save the form (Reader does not have permission to modify, thus save, forms).
You can give Reader permission to do this by opening the form on Acrobat Pro 8.x, clicking on the toolbar menu "Advanced > Enable Usage Rights in Adobe Reader ..." and then saving the form. The Reader users will be able to save filled-out copies of the form.
I spent a long time trying to find the "Advanced" toolbar menu option in Lifecyle Designer and OF COURSE it's not there. I finally re-read your instructions and found it in Acrobat 8 Pro instead, just as you said. Now it works as I had hoped. Thank you.
HI all, I hope this is the best place here to ask, I guess so.
I saw the PDF linked higher, opened it and saw the script for making appear elements based on activating a checkbox.
The fact is I just can't reproduce it !
I copied and pasted all the code in the same conditions, took care to any parameters and whatever I tried to do, it never runs.
I have of course adapted the reference elements to my specific items names.
That's so annoying and irritating.
What I do wrong ?
Are you using Adobe Acrobat or Adobe LiveCycle Designer?
I am using Adobe LiveCycle Designer.
The weird point is that I am sure the first part of the interaction is ok (checking control on change).
Actually if I test with for example another checkbox to be checked if the first one changes it runs. But with the text object, I can't get any result.
Allright, I got it. That was so dumb. I didn't save the pdf as a interactive one. So the interaction did not work. I mean toggling visibility on or off, of a text field. Strange anyway that some behaviours run and other not but saving as interactive solved the non action problem.
Thanks for your help.