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

Creating popups to customise a PDF

Tom
Registered: Mar 21 2007
Posts: 8

Hi,
 
I am struggling to get this relatively simple programme to work, and would be very grateful if anyone could offer any help.
 
I have a form that needs to be changed often, so I am trying to write a javascript that is triggered by a button and sets a series of prompts, like:
 
varTitle = app.response("Title of Meeting:","Customising");
 
OK so thats fine, then I need to replace the text field content with that of varTitle. This is where I have problems, I cannot seem to reference the field properly.
 
I have tried this.getField("MeetingTitle"); and get "null" as a response in the debugger, and trying to change properties of this says that it has no properties.
 
Any help would be greatly appreciated.
 
Thanks,
Tom

My Product Information:
Acrobat Pro 7.0.9, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
First you need to make sure that there is in fact a field on the PDF that is named "MeetingTitle". The name in your script has to exactly match the name of the field.

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

Tom
Registered: Mar 21 2007
Posts: 8
Hi thanks for your reply,

I have tried a number of things, one problem is that I get an error "this.getField is not a function", but I can get around this by referring directly to the field, field now as a text field with no caption.

form1.RegistrationForm.MN

now I want something like:

form1.RegistrationForm.MN.value = app.response("something","here");

but nothing will work here, and I have tried everything I can think of in place of .value, all in vain.

Am I doing something wrong? Any help would be greatly appreciated.

Thanks,
Tom
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
I don't get notified when a new question is posted so unfortunately I didn't get to this answer.

From the code posted above it looks like the problem is that you have a Dynamic LiveCycle form, not an AcroForm. "this.getField()" is an AcroForm function.

If this is true, then the code also has a syntax error. The line should be

form1.RegistrationForm.MN.rawValue = app.response("something","here");

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

amin.nas
Registered: Oct 3 2007
Posts: 37
I am facing the same problem:
"this.getField is not a function"

Did find a way to fix this?

thank you in advance,
amin
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Look at the new response.

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