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

Auto populating fields with data from same form

MMWilliams
Registered: Aug 23 2010
Posts: 16

Hi,

I'm trying to populate a read-only text field with text from another field. What I'd like is to have an option to add text to one spot that will update another field with new information, that can be used repeatedly to create a growing list of info in the read-only field.

Is this at all possible?

Thanks,
Martha

My Product Information:
Acrobat Pro 9.0, Macintosh
MMWilliams
Registered: Aug 23 2010
Posts: 16
Ok, I created a button with this code:

this.getField('field name 1').value = this.getField('field name 2').value

which worked beautifully, however I now need it to keep the original text, allowing the user to add more text and creating an ongoing list of text as its added.

I'm ridiculously new at this, so any insight is welcome.

Martha
try67
Expert
Registered: Oct 30 2008
Posts: 2398
If instead of using "=" you will use "+=", it will maintain the text already in the field, and add the new text to it. Like so:
this.getField('field name 1').value += this.getField('field name 2').value
If you want a space between them, use this:
this.getField('field name 1').value += " " + this.getField('field name 2').value
The plus symbol is used to aggregate strings to one another.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

MMWilliams
Registered: Aug 23 2010
Posts: 16
Thanks! I emailed another site expert (George) and he helped me through the whole thing.