Skip to main content
Participant
June 27, 2023
Answered

In an Adobe PDF fillable form, how do I create a "same as billing address" box that will autofill?

  • June 27, 2023
  • 1 reply
  • 825 views

If you're creating a fillable PDF form, and you want to trigger a script that, when a check box is checked, certain fields auto-fill with previously entered information (i.e. "check here if billing address is same as shipping address", and the filler checks the box, and the fields populate with that information), how do you make that happen? It seems like it might be a script element, but I can't figure out how to adjust the properties of the check box field to trigger that auto-fill response. Any advice?  I'm using an up-to-date version of Acrobat Pro (version 23)

 

This topic has been closed for replies.
Correct answer try67

I would do it using the calculation event of the billing fields, actually. That way, if the values of the shipping fields are changed after the check-box has been ticked they will be automatically updated in the billing section. If you use a script attached to the check-box, that won't be the case.

Here's a sample code that does that (adjust the field names as needed):

 

 

// calc script for "BillingAddress"
if (this.getField("BillingCB").valueAsString!="Off") {
	event.value = this.getField("ShippingAddress").valueAsString;
}

 

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
June 27, 2023

I would do it using the calculation event of the billing fields, actually. That way, if the values of the shipping fields are changed after the check-box has been ticked they will be automatically updated in the billing section. If you use a script attached to the check-box, that won't be the case.

Here's a sample code that does that (adjust the field names as needed):

 

 

// calc script for "BillingAddress"
if (this.getField("BillingCB").valueAsString!="Off") {
	event.value = this.getField("ShippingAddress").valueAsString;
}

 

Participant
June 27, 2023

You are a GOD SEND!!!!  After a bit of manipulation in custom script entering, it all worked perfectly!!!  THanks so much!!!