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

Check Box being selected from DB

Community Beginner ,
Sep 13, 2024 Sep 13, 2024

I have 2 check boxes 100% and another check box that says other with a text field.

 

I have database field called contribution amount.  How can I check the box if the DB value is 100

and when the DB value isnt 100 i want the other check box selected with the contribution amount to appear

 

i tried to do showif contribution !=100 but that didnt work  is there another way i can display it

TOPICS
Modern Acrobat , PDF forms
190
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
1 ACCEPTED SOLUTION
Community Expert ,
Sep 14, 2024 Sep 14, 2024
LATEST

Use this as custom calculation script of DB field (change field names to your actual field names):

var DB = Number(event.value);
//Check checkbox if value equal 100
this.getField("Check Box1").checkThisBox(0, DB === 100 ? true : false);

//Check 'Other' checkbox if value is not 100 and show amount in field called 'Show Amount'
if(DB && DB !== 100){
 this.getField("Other").checkThisBox(0,true);
 this.getField("Show Amount").value = DB;}
else{
 this.getField("Other").checkThisBox(0,false);
 this.getField("Show Amount").value = "";}

 

View solution in original post

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
Community Expert ,
Sep 14, 2024 Sep 14, 2024
LATEST

Use this as custom calculation script of DB field (change field names to your actual field names):

var DB = Number(event.value);
//Check checkbox if value equal 100
this.getField("Check Box1").checkThisBox(0, DB === 100 ? true : false);

//Check 'Other' checkbox if value is not 100 and show amount in field called 'Show Amount'
if(DB && DB !== 100){
 this.getField("Other").checkThisBox(0,true);
 this.getField("Show Amount").value = DB;}
else{
 this.getField("Other").checkThisBox(0,false);
 this.getField("Show Amount").value = "";}

 

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