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

Getting data out of forms

Moop
Registered: May 18 2010
Posts: 14
Answered

I have a form that was created in LiveCycle. If I was the one that originally made it, I would have made it in Acrobat(I'd prefer to not have to remake it if possible). I suspect this might be an issue because of that, but we'll see.

I want to pick data out of the form and send it off to some other script. I have the fields named Type#, Rev# and Pgs# numbered from 1-13. When I type something into the field named Type1 and type this into the console:
var t = this.getField("Type1");
console.println(t);
I get:
null
true
So t is being set to null(or not set to anything)? When I take out the console line, I just get undefined. Is this because the form was made in LiveCycle? Do I have to use some other function because of that? If I am able to pick the values out using the special LiveCycle version of the functions, will I still be able to send off the values(in a global array. Yes, I know I'm lazy and that it's a horrible way to code and that I'm going to have to make a clean-up button) to a script in another file that operates like a normal Acrobat script? Or should I just remake the form in Acrobat?

Or, am I just using getField wrong?

My Product Information:
Acrobat Standard 9.3.1, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
LiveCycle Designer naming is different than Acrobat. LiveCycle appends the form hierarchy to the field name. For example a field in LiveCycle Designer with a simple name of 'name' could have a name in Acrobat as 'form1[0].#subform[0].TextField1[0]'. You will see that the form name and subform name are pre-pend to the field's name. So to get the field names of a LiveCycle Designer form you will need to create a script to create a list of the form field names.

See [url=http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=331]How to extract field names as text?[/url] for a post about a sample report.

George Kaiser