Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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 = "";}