Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Help please: Check box to return value from another field

Avatar

Level 1

Hi and thanks for reading this.

I'm new to LiveCycle and have a problem that no doubt has a simple answer...

Scenario

I have a Text Field called InvoiceAddress.
I have a Check Box called SameAsInvoiceAddress
I have a 2nd Text Field called InstallationAddress

I want the InstallationAddress TextField to be populated with the value from the InvoiceAddress Text Field when the SameAsInvoiceAddress Check Box is checked. When it isn't checked I want the field to remain blank so the user can type in a manual InstallationAddress.

(I've done my other formulas using FormCalc)

Thank you in advance.

Matt

Adobe LiveCycle Designer 8.0 on XP

4 Replies

Avatar

Level 10

Hi,

In the exit event of the checkbox you would have javascript similar to this:

If (this.rawValue == 1) // use double == to test equality

{

     InstallationAddress.rawValue = InvoiceAddress.rawValue;

}

else

{

     InstallationAddress.rawValue = ""; // this will reset the installation address

}

By default a checkbox has a default on value = 1 and off = 0.

Hope that helps,

Niall

Avatar

Level 1

Hi Nial,

This is driving me bonkers now. Thank you so much for your help but I'm struggling still....


I can't seem to get this method to work...plus I've got the challenge of the Check Box making multiple fields return values (i.e. not just address but also company name, city, postcode, phone).

It's probably massively cheeky to ask you this, but could you look at the attached file? It's my first ever attempt at a LiveCycle form (so please don't fall about laughing). You see the top section is the area I'm having a problem with.

Your help is incredibly appreciated.

Matt.

Avatar

Level 1

Hi Niall,

I seem to have found that the following has worked:

Formcalc change-event of the checkbox:

if($ == 1) then
copy_field1 = field1
copy_field2 = field2
...
else
copy_field1 = ""
copy_field2 = ""
...
endif

If you think there is a better way then I'm all ears!

Thanks again,

Matt.

Avatar

Level 10

Hi Matt,

That is the FormCalc equivalent, so will work fine for you. FormCalc doesn't use the .rawValue syntax. Because you only have a handful of fields to script for, it is probably best to do it as you are.

Good luck,

Niall