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

Changing fields in subform instances

DanielKunz
Registered: Jan 22 2008
Posts: 55
Answered

Hi,

I've added some instances of a subform in my form.
Now I want to change the elements of some specific instances.

I tried this JavaScript-code:
Form.List[count].textfield1.rawValue = "text"

where count is the actual number of instances -1

That code does nothing, my form crashes when I arrive that code.

Whats wrong with my code?

Any Ideas?

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Your code uses a SOM expression. The SOM notation can be used directly in FormCalc, but not in JavaScript. Instead you have to use the "resolveNode" function.

EX:

Form.resolveNode("List[" + count.toString() + "].textfield1").rawValue = "text";

Or you could do it in FormCalc:

Form.List[count].textField1 = "text";

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

DanielKunz
Registered: Jan 22 2008
Posts: 55
Hi thomp,

thanks you for your answer.
It works perfectly!!!

Greets
Daniel