Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Populate fields when checkbox is checked

Avatar

Level 1

I have a simple issue...

I have a simple form, which requires the user to type in a shipping address, and a billing address. I've added a checkbox, which I would like to populate the shipping address fields with the billing address fields if they are the same. This is so the user doesn't have to type them in twice. You've seen this in a lot of shopping cart checkout systems.

I know nothing about scripting in LiveCycle, but I think you can use Javascript? I am a little familiar with that, but not enough to get this done. Can someone help me out with this? I would appreciate it very much.

I realize there are some older solutions to this issue on other threads, but links are broken, and nothing has worked.

I attached the PDF in question.

Thank You

1 Accepted Solution

Avatar

Correct answer by
Level 10

Here you go .....the code is on the change event of the checkbox.

Paul

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

Here you go .....the code is on the change event of the checkbox.

Paul

Avatar

Level 1

The file seems like it is stuck in queue.... can you email it to me directly? rev.jason.luna(at)gmail.com

Avatar

Level 4

You can make it yourself...

You make an if statement into the checkbox, javascript:

if (this.rawValue == 1)

{BillingStreet.rawValue = ShippingStreet.rawValue.rawValue;

BillingCity.rawValue = ShippingCity.rawValue;

BillingState.rawValue = ShippingState.rawValue;

BillingZip.rawValue = ShippingZip.rawValue;}

you can make additionally

if(this.rawValue == 0 &&  BillingState.rawValue == ShippingState.rawValue && BillingZip.rawValue == ShippingZip.rawValue && BillingStreet.rawValue == ShippingStreet.rawValue.rawValue && BillingCity.rawValue == ShippingCity.rawValue)

{BillingStreet.rawValue = null;

BillingCity.rawValue = null;

BillingState.rawValue = null;

BillingZip.rawValue = null;}

will if the checkboxbutton was checked, the user didn't do any changes + the user unchecks it, delte the entries... if the user changed it even slightly it won't be delted.