Highlighted

If Check Box is Checked, populate another field

New Here ,
Aug 21, 2020

Copy link to clipboard

Copied

In the form I am creating, I have a Check Box.  If the Check Box is selected, I'd like to have another Text Box populate with a Calculation.

I currently have the calculation work but I only want it displayed when the Check Box is marked.

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

You can use something like this:

 

if (this.getField("CheckBox1").valueAsString=="Off") event.value = "";

else {

// place calculation code here

}

 

Edit: Typo fixed in code

TOPICS
Acrobat SDK and JavaScript

Views

36

Likes

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

If Check Box is Checked, populate another field

New Here ,
Aug 21, 2020

Copy link to clipboard

Copied

In the form I am creating, I have a Check Box.  If the Check Box is selected, I'd like to have another Text Box populate with a Calculation.

I currently have the calculation work but I only want it displayed when the Check Box is marked.

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

You can use something like this:

 

if (this.getField("CheckBox1").valueAsString=="Off") event.value = "";

else {

// place calculation code here

}

 

Edit: Typo fixed in code

TOPICS
Acrobat SDK and JavaScript

Views

37

Likes

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
Aug 21, 2020 0
Most Valuable Participant ,
Aug 21, 2020

Copy link to clipboard

Copied

You can use something like this:

 

if (this.getField("CheckBox1").valueAsString=="Off") event.value = "";

else {

// place calculation code here

}

 

Edit: Typo fixed in code

Likes

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
Reply
Loading...
Aug 21, 2020 0
bfry2461 LATEST
New Here ,
Aug 22, 2020

Copy link to clipboard

Copied

Thank you.

Likes

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
Reply
Loading...
Aug 22, 2020 0