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

If Check Box is Checked, populate another field

Explorer ,
Aug 21, 2020 Aug 21, 2020

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
929
Translate
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

Translate
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

Translate
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
Explorer ,
Aug 22, 2020 Aug 22, 2020
LATEST

Thank you.

Translate
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