Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

TextField Box to calculate sum of checkboxes that are checked

stockman
Level 1
Level 1

hi! I'm new with scripts and tried to google to find the answer, but am at a loss.

 

I have 3 checkboxes (named: Check Box1, Check Box2, and Check Box3) that populate a corresponding textfield with a specific numeric value associated with that textfield.

My problem is I have a 4th textfield that I want I would like to sum the textfields that are populated based off the checkboxes. The issue I am having is that the Total function, doesn't recognize when one of the textfields is not populates, it adds that value in the total even if the checkbox is not checked.

 

Code I used for the checkboxes:

var nHide = event.target.isBoxChecked(0)?display.visible:display.hidden;
this.getField("Apple").display = nHide;

 

stockman_0-1611956084945.png

 

0 Replies