Copy link to clipboard
Copied
I am working on a form that will have 3 different sections — all with identical fields (“Attn”, “Company”, “ Address”, “City”, “State”, “Zip”, “Phone”, “Email”, etc). Each section may end up with different content, but may occasionally need to be the same. In this case, I would like the user to click a checkbox and have sections 2 & 3 auto-populate using the content from the fields in section 1. I am not versed in javascript, but I am hoping someone can give me a nudge in the right direction. Thanks in advance!
Copy link to clipboard
Copied
Try this:
if(event.target.value != "Off"){
this.getField("Attn_2").value = this.getField("Attn").value;
this.getField("Attn_3").value = this.getField("Attn").value;
this.getField("Company_2").value = this.getField("Company").value;
this.getField("Company_3").value = this.getField("Company").value;
this.getField("Delivery Address_2").value = this.getField("Delivery Address").value;
this.getField("Delivery Address_3").value = this.getField("Delivery Address").value;}
Copy link to clipboard
Copied
Lets say you have fields "Email1","Phone1" and "Email2","Phone2", as Mouse UP event of checkbox you can use script like this:
if(event.target.value != "Off"){
this.getField("Email2").value = this.getField("Email1").value;
this.getField("Phone2").value = this.getField("Phone1").value;}
Adapt code to your needs.
Copy link to clipboard
Copied
Thank you for your reply. I added the script to the checkbox actions and get an illegal character error in the JavaScript Editor (see highlighted line in screenshot). Pardon my ignorance on this.
Copy link to clipboard
Copied
Try this:
if(event.target.value != "Off"){
this.getField("Attn_2").value = this.getField("Attn").value;
this.getField("Attn_3").value = this.getField("Attn").value;
this.getField("Company_2").value = this.getField("Company").value;
this.getField("Company_3").value = this.getField("Company").value;
this.getField("Delivery Address_2").value = this.getField("Delivery Address").value;
this.getField("Delivery Address_3").value = this.getField("Delivery Address").value;}
Copy link to clipboard
Copied
Thank you so much for your help on this! This works exactly as I had hoped.

