• Resolved manushaanjaana

    (@manushaanjaana)


    Hi,
    I’m using this code to get a final value to a text field
    (function(){
    var newvalue;
    if (fieldname12== true)
    newvalue= fieldname5 * 180 *0.025;
    return newvalue;
    else return 0
    })();
    fieldname12 is a check box and if the check box is true the functionality should be work on but I’m not sure about what to use to make it work.
    Can you please tell me, how to get the value of check box ;
    is it;
    fieldname12== ‘yes’
    or
    fieldname12== true
    or
    fieldname12== yes
    or anything else

    Hoping help
    Thank you

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter manushaanjaana

    (@manushaanjaana)

    Plugin Author codepeople

    (@codepeople)

    Hello @manushaanjaana

    You should to compare with the value entered through the value of the choice, in the settings of checkbox field (Pay attention: Javascript is a case sensitive language).

    For example, if you have entered the text: True as the choice’s value, the equation would be similar to:

    
    IF(fieldname12== 'True', fieldname5 * 180 *0.025, 0)
    

    Note: in the previous equation I’m using the “IF” operation distributed with the plugin, instead the “if” conditional statement of javacript, because in this case the equation would be simpler.

    Best regards.

    Thread Starter manushaanjaana

    (@manushaanjaana)

    For the check box value, can you explain what this mean and what are the inputs can be given to this value

    Plugin Author codepeople

    (@codepeople)

    Hello @manushaanjaana

    As you can see in the screenshot below, every choice in a checkbox field has associated a text and a value, the text is visible in the form, and the value is used by the equations:

    Best regards.

    • This reply was modified 4 years, 11 months ago by codepeople.
    Thread Starter manushaanjaana

    (@manushaanjaana)

    It’s working, thank you so much

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Check box’ is closed to new replies.