• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Auto Populate TextField When CheckBox is Checked

New Here ,
Feb 21, 2025 Feb 21, 2025

Copy link to clipboard

Copied

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.

 

 

 

christopher_0068_2-1740149977493.pngexpand image

 

christopher_0068_1-1740149905466.pngexpand image

Thank you.

TOPICS
Create PDFs , JavaScript , PDF , PDF forms

Views

76

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 21, 2025 Feb 21, 2025

Copy link to clipboard

Copied

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
}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 21, 2025 Feb 21, 2025

Copy link to clipboard

Copied

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.

 

christopher_0068_0-1740154164435.pngexpand image

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 21, 2025 Feb 21, 2025

Copy link to clipboard

Copied

I tried this, but getting syntaxerror.

 

If (event.target.value != "Off") {
this.getField("Text 19").value = this.getField("Text12").value;
this.getField("Text 20").value = this.getField("Text 13").value;
this.getField("Text 24").value = this.getField("Text 16").value;
this.getField("Text 25").value = this.getField("Text 17").value;
this.getField("Text 26").value = this.getField("Text 21").value;
this.getField("Text 27").value = this.getField("Text 22").value;
// etc
}
else {
this.getField("Text 19").value = "";
this.getField("Text 20").value = "";
this.getField("Text 24").value = "";
this.getField("Text 25").value = "";
this.getField("Text 26").value = "";
this.getField("Text 27").value = "";
// etc
}

 

christopher_0068_0-1740155850295.pngexpand image

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 21, 2025 Feb 21, 2025

Copy link to clipboard

Copied

JS is case-sensitive. Use "if", not "If".

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 21, 2025 Feb 21, 2025

Copy link to clipboard

Copied

This worked! Thank you so much!!!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 21, 2025 Feb 21, 2025

Copy link to clipboard

Copied

LATEST

Sorry, I misspelled the “if”.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines