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

If Check Box is Checked, populate another field

Community Beginner ,
Aug 21, 2020 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.

TOPICS
Acrobat SDK and JavaScript

Views

191

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
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 21, 2020 Aug 21, 2020

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
Community Expert ,
Aug 21, 2020 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
community guidelines
Community Beginner ,
Aug 22, 2020 Aug 22, 2020

Copy link to clipboard

Copied

LATEST

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
community guidelines