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

Copying text field to another based on a checkbox

alcidesfialho
Registered: Dec 13 2010
Posts: 2
Answered

Hi there,
 
I'm struggling with Acrobat X. I have a customer form with an address. If a check box is set the address should be copied to another field billing address.
 
I'm using a mouse up action in the checkbox :
 
if(this.getField('CheckBox2').value == 'Yes') {
this.getField('Morada2').value = this.getField('Morada').value;
}
 
When debugging I get the message :
 
TypeError: this.getField("Morada") is null
 
But the field Morada is filled....
 
Can someone help me out please ?
 
Thanks,
 
Alcides

My Product Information:
Acrobat Pro 10.0, Macintosh
maxwyss
Registered: Jul 25 2006
Posts: 255
Accepted Answer
How did you create the form? Were you using LiveCycle Designer? If so, you have to look at the limited capabilities of the "JavaScript" implemented in that piece of software. Acrobat JavaScript won't work with such forms.

If you have been using Acrobat to create the form, double-check the spelling of the field name.

Also, you should try double quotes instead of single quotes throughout your scripts.

And finally, you might have fewer issues by addressing the check box as event.target such as in

if (event.target.value == "Yes") {


Hope this can help.

alcidesfialho
Registered: Dec 13 2010
Posts: 2
Indeed with some modifications....I thought the event.target.value should be substituted by the checkbox name. Thanks.