Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Billing then Shipping set to global, but need to allow subsequent revisions in shipping address

Avatar

Level 2

Here's my LiveCycle Designer ES form setup (pertinent sections only):

Billing address

then

Shipping address

I have same fields set to global so they copy down automatically by default.


THEN I have a checkbox that's default to ON with a mouseover "UNCHECK to modify Shipping address" (this allows the fields to be pre-filled in for only minor subsequent edits since they often share similar fields with Billing).

So basically I need help from you so that when they uncheck that checkbox, it allows edits to shipping that WONT change the (global) same fields in billing. I know, it seems counterintuitive, but from the customers point of view, it'll provide some convenience to have these fields pre-filled in, so they only have to do minor edits. In fact, it would be great if this could be done without the need for a checkbox at all (who needs it right?), ie the fields automatically fill down from billing to shipping, BUT allow subsequent edits of shipping that won't then change the billing.

Thanks 10x if you can help me.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

You can contact us via http://www.assuredynamics.com.

I will try and have a look when I get a chance.

Niall

View solution in original post

15 Replies

Avatar

Level 9

Hi,

You can set the script in the exit event of Billing Address. No need to make the fields of same name and no need to make the global binding.

In the xit event of Billing Addres :

Shiiping_Address.rawValue = Billing_Address.rawValue;

Thanks,

Bibhu.

Avatar

Level 2

That didn't work.

If I turn off global, and do that, the fields don't even copy down from Shipping to Billing, which takes me back to square one. I need them to copy down but then allow edits of Billing fields without that changing the upper Shipping section.

Avatar

Level 9

Hi,

It's getting bit confused..In which addrress you want to enter the values first , Shipping or Billing ? Is the value of Shiiping needs to be copied to Billing after entering the value in Shipping or just the reverse ?

Thanks,

Bibhu.

Avatar

Level 2

It's Shipping (1st) then Billing, but need to allow subsequent revisions in BILLING address, so as soon as they complete the last Shipping field, it autofills those same fields down in Billing, but allowing us to then edit those Billing fields as necessary. Sorry for any confusion.

Thanks.

Avatar

Level 9

Ok.Then we need to put the script in the exit event of first field i.e Shipping. So that when the control exits from the Shipping field it will automatically show the same value in the Billing field.

So, put the script in the exit event of Shipping.

Billing_Address.rawValue = Shipping_Address.rawValue;

Bibhu.

Avatar

Level 2

No difference.

I put the script on the last field in Shipping. You fill in shipping. Then, on exiting that last field, the Billing fields (exact same) SHOULD fill, but they don't....so I can't even test editing them.

Avatar

Level 10

Hi,

Bibhu's script will work. If it helps, I have a previous example here: https://acrobat.com/#d=xlp1fdqbrseULbRJpw6u9g.

Good luck,

Niall

Avatar

Level 9

Hi,

Here is a sample form for you. https://acrobat.com/#d=-Aj70vGXA9o4*kaB857v8w

Please save the form as Adobe Dynamic XML form. Not static.

Thanks,

Bibhu.

Avatar

Level 2

Ok, thanks for hangin' in there with me. I was able to see the form & proper script (which was a different script than yours) using NOD's link. Yes, that indeed works fine on their form, and it has similar functionality as we're needing (form data copies down by FIRST checking but allows you to then edit by UNchecking).

However, I'm afraid, following the explicit simple instructions there (pasting 2 easy scripts), it's not working on my form (?). they don't even copy down. I'd like (either of) you to take a look at the form if you can email me directly, I'm sure you'll see the problem right away.

Thanks again!

Avatar

Level 9

Hi,

Could you please upload your form to Acrobat.com and paste the link here so that we could look into the problem ?

Thanks,

Bibhu.

Avatar

Level 2

the form has private / contact info throughout the form. if you email me directly, i can attach it. otherwise another way may be suggested. thanks.

Avatar

Level 2

Niall,

     I spent a couple days on this, a bit frustrating, and was even able to reproduce it, but not on my actual form. Here's where we're at:

1. The link you provided was excellent for the "copy down" (shipping to billing addresses) script you posted. That online sample worked fine, but when I copied the code (i think perfectly) into my form I couldn't get it to work, so I tried creating a form from scratch, just bringing over 2 address blocks and making their (see below) codes match the fields...and it worked. Dynamic vs static didn't make a difference. Can I forward you the actual form so you can help me find the error?  I'm confident and hopeful you'll be able to spot the error.

To save you some time, here's the script:

PASTE THIS Script in the click event of the checkbox:


if (this.rawValue == 1)
{
address1b.rawValue = address1a.rawValue;
address2b.rawValue = address2a.rawValue;
address3b.rawValue = address3a.rawValue;
address4b.rawValue = address4a.rawValue;
address5b.rawValue = address5a.rawValue;
address6b.rawValue = address6a.rawValue;
}
else
{
address1b.rawValue = null;
address2b.rawValue = null;
address3b.rawValue = null;
address4b.rawValue = null;
address5b.rawValue = null;
address6b.rawValue = null;
}


==========================================
AND
==========================================

PASTE THIS Script in the exit event of the "Residential address" fields:

// fire script in checkbox
duplicateAddress.execEvent("click");

Of course, I also made sure to change the checkbox label to "duplicateAddress" in the binding tab.

There's no global binding. It's all set to normal.

Please let me know how i can get the form to you. I know you'll spot the error right away.

big thanks.

davidb

Avatar

Correct answer by
Level 10

Hi,

You can contact us via http://www.assuredynamics.com.

I will try and have a look when I get a chance.

Niall

Avatar

Level 2

You totally solved it Niall. Thanks.

Just to help out others who may be following along, or happen to trip across this thread, this turned out to be the problem. Thanks for your help:

******

You  had two tables with the same name. This would require you to  resolveNodes, which is not efficient. I have named the first table  “Table4a” and the second “Table4b”.

In addition, you were only referencing the object in your script.  Because each of the objects are buried inside tables, the checkbox  cannot see that “address1b” exists. When scripting you need to give a  sufficiently full reference. For example “Table4.Row1.address1b”.

Lastly you did not have the exit script in all of the objects in the first table.

******