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

need help with copying textbox values from one textbox to another

kajirus3
Registered: May 18 2008
Posts: 16

Help

Am in need of guidance. I am a begininer and can someone show me how to

copy text that is in a textbox Mail_Address to another Texbox Residence_Address
and City_Address to Residence_City

when the checkbox Named Same is checked

thanks for all your help

My Product Information:
Acrobat Pro 8.1.2, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Moving data from one field to another is very simple. First you have to acquire the JavaScript object of the fields in question with the "getField()" function. The value of the field is in the value property, so it's just a matter of assigning one to the other

this.getField("Residence_Address").value = this.getField("Mail_Address").value;

Since you want this to happen on the check, you need code for testing the value of the check box. Put this code in the MouseUp Event script for the checkbox.
if(event.target.isBoxChecked(0))this.getField("Residence_Address").value = this.getField("Mail_Address").value;

You can find information on how to enter scripts and lots of other topics in the articles at JavaScript Corner on this site.

You'll also need the Acrobat JavaScript Reference which you can download from here:

http://www.adobe.com/devnet/acrobat/javascript.php

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

kajirus3
Registered: May 18 2008
Posts: 16
Thanks that worked great!!!!