These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

How to reference a subform from a button inside the subform

StevenD
Registered: Oct 6 2006
Posts: 368
Answered

I'm just wondering if a script I am using to make a subform invisible is really right or if there is a better way to script the action or something I need to add to it to make it work better.

I have a subform named "InstructionDialog1SF" and within this subform there are three fields, two static text objects named "OverviewCol1", "OverviewCol2", and a button named "Close". In the "Close" button I have this script,

InstructionDialog1SF.presence = "invisible";

which makes the "InstructionDialog1SF" become invisible when clicked. It works on my computer when I open it in Preview and when I open the form in Acrobat 8 Professional. I sent the form to a guy in the Japanese office and he says the "Close" button doesn't seem to work. He says the "Close" button worked fine in Adobe Reader 9 and but when he opened the form in Acrobat 8 Professional he says the "Close" button doesn't work.

I saved the form as an Acrobat 8 (Dynamic) XML Form.

StevenD

My Product Information:
Acrobat Pro 8.1.2, Windows
lkassuba
ExpertTeam
Registered: Jun 28 2007
Posts: 3636
There is some interesting dialog on this topic (including a script) in the following post [url=http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=13447]Hide/show (sub)fields with a check box[/url].

Lori Kassuba is an AUC Expert and Community Manager for AcrobatUsers.com.

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
try this code

this.parent.presence = "invisible";

It makes the code both generic and specific to the subform the button is inside. Referencing the subform name directly could cause some confusion if there is more than one subform with that name.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

StevenD
Registered: Oct 6 2006
Posts: 368
I heard back from the guy in Japan. He says the Close buttons still do not work in the form. I'm at a loss as to why that is the case. Of course I am not sure if he is using an Asian version of Acrobat or not (even if there is one) and that is causeing the problem or what it is. I wouldn't think that would have anything to do with it. It works behind the scenes. This kind of thing is difficult when the client is on the other side of the world and a day a head.

Thanks for the help everyone.

StevenD

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Without more information it's impossible to know why the form isn't working for this guy. Have other people used the form successfully? You could always try to get more info by making up some simple test forms for this guy to try. Also, try saving as Acrobat 7 dynamic. See if that has an effect on things.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

koenigma
Registered: Jan 23 2008
Posts: 45
I had a similar problem with a form I had sent out, and it drove me crazy trying to correct the problem.

You might want to check with the person if they have an earleir version of Acrobat Reader installed on the computer, since it seems that if you click on the form to open it will open in the earlier version by default. Since I had the same problem you are describing.

The problem went away after removing the older version of Acrobat Reader from the computer.
StevenD
Registered: Oct 6 2006
Posts: 368
I didn't think of that. Thanks for tip.

I got an email the first part of this week from the guy and says the form is now working as it should. I'm not sure if he has just given up on the Close buttons and is satisfied with the rest of the form which is working as it should or not. I am going to remember this for the future and in the mean time notifiy him of this and have him do what you suggest and check and remove any other versions of reader if that is the case.

Maybe I should get the company to send me on a trip so I can see first hand. :-)

Thanks everyone for the help on this.

StevenD