Skip to main content
Participant
February 21, 2025
Question

Auto Populate TextField When CheckBox is Checked

  • February 21, 2025
  • 2 replies
  • 397 views

Hello.

I'm needing some help.  I have figured out how to auto populate when I check box Same As Legal Address.  However, when I do not check the box Same As Legal Address, and I have the Legal Address section filled, and when I go to the Remit Address section, when I type something and click on another text field, it disappears.  This is my java script that I'm using in Text 19 in properties 

 

event.value = this.getField("Text12").value;
if (this.getField("SALA").value =="Off")event.value="";

 

I think my issue is with this part at the end...    event.value="";   because when I typed in event.value="Some Value";  it actually put the that in the Text 19.  

 

Any help would be greatly appreciated.

 

 

 

 

Thank you.

2 replies

JR Boulay
Community Expert
Community Expert
February 21, 2025

Sorry, I misspelled the “if”.

Acrobate du PDF, InDesigner et Photoshopographe
JR Boulay
Community Expert
Community Expert
February 21, 2025

Place this script as a Mouse up action in the checkbox:

If (event.target.value != "Off") {
	this.getField("Text 19").value = this.getField("Text 12").value;
	this.getField("Text 20").value = this.getField("Text 13").value;
	this.getField("Text 24").value = this.getField("Text 16").value;
	// etc
}
else {
	this.getField("Text 19").value = "";
	this.getField("Text 20").value = "";
	this.getField("Text 24").value = "";
	// etc
}
Acrobate du PDF, InDesigner et Photoshopographe
Participant
February 21, 2025

Thank JR Boulay.  I think I'm missing something.  I have put this in the 

"SALA" checkbox, Mouse Up, Run Java Script.  I getting the following error.