henry
asked on
write code for check box in Adobe Form
Hello,
I'm building PDF form.
Have two sections : "Bill To" and "Ship To".
"Bill To" have few fields: Company, Address, City, State, Zip, Country and Phone.
"Ship To" has exactly same set of fields like above.
Have also checkbox in "Ship To" section saying "same as Bill To".
I need a code what I can apply to checkbox:
if checkbox is checked copy all info from Bill To fields to Ship to fields.
thank you for help,
Henry
ASKER
I have some issue make your code work.
I created below and working pretty well, except:
Last two lines, entry for phone# not working. Is any limitation in that kind of code how many lines I can use it ?
if I eliminate let say Country phone fields are working.
if (event.target.value=="Yes" ) {
this.getField("CompanyST") .value = this.getField("Company").v alue;
this.getField("CompanyST") .readonly = true;
this.getField("AddressST") .value = this.getField("Address").v alue;
this.getField("AddressST") .readonly = true;
this.getField("CityST").va lue = this.getField("City").valu e;
this.getField("CityST").re adonly = true;
this.getField("StateST").v alue = this.getField("StateProvin ce").value ;
this.getField("StateST").r eadonly = true;
this.getField("AddressST") .value = this.getField("Address").v alue;
this.getField("AddressST") .readonly = true;
this.getField("ZIPST").val ue = this.getField("ZIP").value ;
this.getField("ZIPST").rea donly = true;
this.getField("CountryST") .value = this.getField("Country").v alue;
this.getField("countryST") .readonly = true;
this.getField("Phst").valu e = this.getField("Phone").val ue;
this.getField("Phst").read only = true;
}
I created below and working pretty well, except:
Last two lines, entry for phone# not working. Is any limitation in that kind of code how many lines I can use it ?
if I eliminate let say Country phone fields are working.
if (event.target.value=="Yes"
this.getField("CompanyST")
this.getField("CompanyST")
this.getField("AddressST")
this.getField("AddressST")
this.getField("CityST").va
this.getField("CityST").re
this.getField("StateST").v
this.getField("StateST").r
this.getField("AddressST")
this.getField("AddressST")
this.getField("ZIPST").val
this.getField("ZIPST").rea
this.getField("CountryST")
this.getField("countryST")
this.getField("Phst").valu
this.getField("Phst").read
}
Check your console for errors message and post it
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
First add an eventlistener to the checkbox element.
Open in new window
And the function
Open in new window