CalcBuilder Forum

YES/NO (checkBOX) - VALUE number

User moon_1309 2013-12-04 21:39:58


My calculator consists of sets "multiple->YES/NO".
payment must occur by summing the checkboxes (YES/NO) field

But the FIELD, (YES/NO - type), has no option where you can enter a value.

How can I set the "number" of the "field"?
(Option list)
Actions: Add Delete All-------------------------Name_______Value_____
SQL Actions: Add Del
CSV Actions: Add

Moonsoft support 2013-12-05 09:39:04

checkboxes have value "Y" when selected, that you can use to confirm if user checked or not the option, but you can give them a numeric value at the code, you don't need to overwritte the default value of the check. Here a couple of examples:

Field: check0- typed YES/NO
Field: check1- typed YES/NO

//at the code, we'll create values for each check, but we give them different name:


//if you want to calculate the sum of the two options, regardeless of whether are selected or not:


//and now, if you want to sum ONLY the selected values:


//if check0 is selected, add its value to result


//if check1 is selected, add its value to result


//you will get at $result the sum of the options

Hope this helps, regards

List Manager

Build different lists for your site

Buy now!

Perfect for small code changes or to correct any bug at your site

Buy now!