Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Ship to Same as Bill to Check Box

Avatar

Level 2

What I am looking to do is have a check box that says "Ship to is the same as Bill to" and if it is clicked, then the address populates in the fields below, otherwise the user can free text entry the address.

I am not sure how or even if this can be done so any help would be appreciated.

The Bill to address is populated based off a selection in a dropdown so it is hard coded into the form and fired using the exit event and the following script:

TextField1.rawValue = this.rawValue;

That part works like a charm, I am looking to have the shipping fields, i.e. Name, Address, City, St, Zip, populated automatically if the check box is marked.

Thank you in advance!

Ken

1 Accepted Solution

Avatar

Correct answer by
Level 10
13 Replies

Avatar

Level 4

Hi,

     Apologize if my understanding is wrong, please find the sample from the link below. And let me know, whether you are looking for this functionality or not.

https://acrobat.com/#d=M-Pt*KNjL3F54h*AYIQ4fg

thanks,

Rajesh

Avatar

Correct answer by
Level 10

Hi,

There is an example here as well: https://acrobat.com/#d=xlp1fdqbrseULbRJpw6u9g.

Niall

Avatar

Level 2

I have tried to follow the link you provided for the example but I get a screen from acrobat.com com up with the following message:

You don't have the latest version of the Adobe® Flash Player. You must install it to use Adobe® Acrobat.com.

I installed the latest version and I still get this error.

Any ideas?

Ken Lahvic | Jr. Business Systems Helpdesk Analyst | Empire Today, LLC | Office: 847.583.4441 |Cell: 630-854-2225|

Avatar

Level 2

Nevermind, I guess I didn't close all instances of IE before I retried the link...

Ken Lahvic | Jr. Business Systems Helpdesk Analyst | Empire Today, LLC | Office: 847.583.4441 |Cell: 630-854-2225|

Avatar

Level 2

Niall -

This is what I would like for it to do, however, the difference is I have my Billing Address populated in one text field, and I would like that address to populate in separate fields like your example if the checkbox is selected otherwise they will be free text fields.

Is this possible?

Ken Lahvic | Jr. Business Systems Helpdesk Analyst | Empire Today, LLC | Office: 847.583.4441 |Cell: 630-854-2225|

Avatar

Level 10

Hi Ken,

Without seeing the form, I would say that it MAY be possible, but it would need some script. Basically you would need to split the string from the Billing Address back down into it constituent parts.

If the Billing Address is hard wired into the form, do you have many addresses? How are the addresses stored in the form?

Can you set up the Shipping Address as a single textfield as well? Or split the Billing Address down into a number of fields?

I think that you should look at the last options above, becuase I think this will work better than developing a script to split the Billing Address string.

Niall

Avatar

Level 2

I could split the billing address down, but I would need some help there.

What is happening is the billing address is populated in the single text field based on a selection from a dropdown...

Company Name Selected ---> Address Populated

It took me forever to figure out how to do that, and I am not sure how to change it to when the company name is selected the address populates into individual fields, i.e. address1, address2, city, state, zip code.

If you have any ideas that would be helpful.

Ken Lahvic | Jr. Business Systems Helpdesk Analyst | Empire Today, LLC | Office: 847.583.4441 |Cell: 630-854-2225|

Avatar

Level 10

Ken,

I would change your existing script, so that it references multiple fields.

Your current script (JavaScript) probably looks like this:

if (this.rawValue == "Assure Dynamics")

{

     BillingAddress.rawValue = "A street, A city, A state";

}

Instead you could reference several fields in one hit. Again this is JavaScript and I would recommend using the exit event of the Company dropdown:

if (this.rawValue == "Assure Dynamics")

{

     BillAddress1.rawValue = "A street";

     BillAddress2.rawValue = "A second street";

     BillCity.rawValue = "A city";

     BillState.rawValue = "A state";

     BillZip.rawValue = "A zip code"; 

}

Note, that you will need to change the object references to match the naming convention in your form.

You could also use a switch statement instead of the if/else statement. It just depends on what you are comfortable with.

Niall

Avatar

Level 2

Niall -

I got the bill to ship to portion to work so I want to thank you immensely for your help.

I have one more question for you if your up to the task:

I have a dropdown with facility names that populate the billing address based on that dropdown, what I would like to do if it is possible is create a way for a user of the form to add a new address and facility name to the list and the address to the list.  Is this possible?

Here is the code I use to store the addresses in the form, hopefully this is all you need to direct me:

form1.#subform[0].DropDownList1::exit - (JavaScript, client)

if

(this.rawValue == "Apple Blossom Place")

{

BillAdd.rawValue

= "5298 Crabtree Drive";

BillCity.rawValue

= "Erie";

BillState.rawValue

= "PA";

BillZip.rawValue

= "16509-3890";

}

Thank you in advance for the assistance.

Ken

Avatar

Level 10

Hi Ken,

You are getting into tricker areas now, which will involve quite a bit of scripting.

The first part for adding a new name to the dropdown is provided here by Steve Walker: http://forums.adobe.com/message/1949975#1949975. This is a great solution, but as I said will involve a bit of scripting to get it workign in your form.

All this does is add a name to the dropdwon, but it does not add any logic to either add the new address OR populate the address fields with the new details.

What you are looking for would (afaik) be better served with a database connection. Where the facilitiy names and address (and other info) is written to and read from a database.

Niall

Avatar

Level 2

Thanks for the information Niall. Just so I know for my own information, if there is no database connection, is the adding and populating of addresses even possible? We do not have a database to connect to, so I was wondering if this is possible without.

Ken

Avatar

Level 10

Hi Ken,

To be honest, I doubt it. Yes, you will be able to add the new facility to the dropdown, but you will not be able to change the logic at runtime to use this new information to populate the various fields.

You could store  the facility name and address in an external XML file and then load this into the form using Acrobat. When you have a new facility's details to enter, you would need to edit the XML file and then re-import into the form in Acrobat. Again not for the fainthearted - there is a bit of work in setting it up.

Is that acceptable?

Niall

Avatar

Level 2

Yes, that is fine. I figured I was pushing the boundaries with this idea. Maybe I can talk the company into attaching a db to the form to handle this.

I appreciate your help with everything!

Until my next issue comes up,

Ken

Ken Lahvic | Jr. Business Systems Helpdesk Analyst | Empire Today, LLC | Office: 847.583.4441 |Cell: 630-854-2225|