• Resolved Radovan

    (@radovand)


    Hi,

    I need help with solving the following problem: How to create dynamic checkbox values based on ”calculated fields” or ”hidden fields”?

    • I have defined fieldname1 as a “Calculated field” and assigned it the value 10.
    • I have defined fieldname2 as a “Calculated field” and assigned it the value 20.
    • I have defined fieldname3 as a “Calculated field” and assigned it the value 30.

    I have defined fieldname4 as a “Checkbox” with 3 choices:

    • Choice 1: I want to assign the value from fieldname1;
    • Choice 2: I want to assign the value from fieldname2;
    • Choice 3: I want to assign the value from fieldname3;

    So that when “Choice1” is selected, fieldname4 receives the value 10, which is the value of fieldname1.

    I have tried various options and have not been able to solve the problem, even though it seems simple.

    Best regards,

    Radovan D.

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

    (@codepeople)

    Hello @radovand

    Thank you very much for using our plugin. The checkbox fields include the setChoices methods. The parameter of the setChoices method is an object with “texts” and “values” properties. So, you can insert a calculated field that contains as part of its equation a piece of code similar to:

    getField(fieldname3|n).setChoice({values:[10, 100, 1000]});

    But replacing the values with the fields’ names.

    If you need a custom coding service to implement this feature on your form, you can contact us through the plugin website: Contact Us

    Best regards.

    Thread Starter Radovan

    (@radovand)

    Thank you for your reply.

    The idea was to use some general values, which I set at the beginning of the form and then use in various fields in the form, including checkbox or radio buttons.

    For example to define fieldname1, fieldname2 and fieldname3 at the start of the form, then use them in various places in the form, for example in a fieldname4 which is of type checkbox, in a fieldname5 which is of type radio button etc.

    Plugin Author codepeople

    (@codepeople)

    Hello @radovand

    Yes, the process would be the same for radio buttons, and checkboxes. You need to assign the choices’ values with a piece of code similar to the code I entered in the previous entry through an auxiliary field. It can be a calculated field or an “HTML Content” field.

    If you prefer we implement this process in your form, you can contact us through the plugin website.

    Best regards.

    Thread Starter Radovan

    (@radovand)

    Ok, Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to create dynamic checkbox values based on calculated fields?’ is closed to new replies.