• Resolved raj12345

    (@raj12345)


    Is there a way to add custom calculations for checkboxes?

    For example, if I have a checkbox with choice of 6 options – how can I make 2/6 free items i.e. ‘0’ value, but the other options with a value.

    I understand this is possible to add set values for each item in the value field, but I would prefer if the any two ticked show 0 value, but any additional selected show additional values.

    Is this possible?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @raj12345

    Yes, of course, that’s possible. Every choice in the checkbox field has two entry boxes for the choice value and text. For free choices enter the number 0 as their values, and the corresponding numbers in the other choices’ values.

    To get the sum of the ticked choices, you should use only the field’s name.

    For example, if the checkbox field is the fieldname1, and you want to get the sum of ticked choices, the equation associated with the calculated field would be:

    fieldname1

    Best regards.

    Thread Starter raj12345

    (@raj12345)

    Hi,

    Many thanks for your support. My query was relating to something else, but your colleague has answered it via email support. I have shared their response below in case other users wanted to know the solution. Cheers.

    Hello,
    
    There are multiple alternatives, but if not matter the choices selected, the two first ticked are free, a possible solution would be to enter the number 1 as the choices' values, and I'll try to describe the equation with a hypothetical example:
    
    Assuming the checkbox field is the fieldname1, and the price for every additional checkbox (two first free) is $10, the equation can be implemented as follows:
    
    MAX(fieldname1-2,0)*10
    Plugin Author codepeople

    (@codepeople)

    Perfect !!!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Dynamic checkbox value calculation’ is closed to new replies.