These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Checkbox that can duplicate fields

libraboy
Registered: Dec 14 2007
Posts: 94

Hi ALL,

Can someone please help me to create a checkbox that can copy all input in the textbox.

Example:

Address 1 Address 2
The address 1
The address 2
The address 3
Country, Postal Code

When you check the checkbox your info in address1 will copied in address 2.

Please help me.

Thanks

My Product Information:
LiveCycle Designer, Windows
PetafromOz
Registered: Jun 8 2009
Posts: 230
Hi Libraboy,

I'm not real sure what you're after here. Is the idea of this checkbox to be one of those: 'as above' type checkboxes?

In other words, for example a delivery vs a postal address - check the box if they're both the same?

If that's what you're trying to do, there are two ways you can handle it.
- One is to duplicate the information, as you've requested above,
- or the other is to simply provide fields in case the delivery address is different, or if they're the same, check the box and the entry fields are hidden.

The way I've done it in the past is to wrap a subform around the address info and my checkbox simply says: 'As Above?'
If checked, the delivery fields are hidden.
So this is how it looks:

form1.Pg1SF.AppInfoSF.RegBusAddSF.RegChkbox::change - (JavaScript, client)

if(this.rawValue == 0)
{
Background.RegBusAddSSF.presence = "visible";
{
else
{
Background.RegBusAddSSF.presence = "hidden";
}



Alternatively, if you want to duplicate the information, in the event of the checkbox being checked, you will need to set the rawValue of your Address 2 fields to equal those of your Address1 fields.

So:

if (checkbox.rawValue == 1)
address2.rawValue = address1.rawValue;


etc.

Again you could wrap a subform around your groups to make it a bit tidier.

Hope this makes sense.

from way... underground at Parkes - central West NSW - Australia

libraboy
Registered: Dec 14 2007
Posts: 94
Hi,

Thanks for your reply! I tried your last code but still now working. Can you please provide me a sample?

Thanks for your help!