• Resolved PB

    (@ohtusabes)


    Hi @codepeople

    I am using checkboxes (fieldname45) with several options. Each option triggers dependencies that are HTML fields (for example, fieldname11, fieldname46, etc.). My intention is that some options exclude others when selected. For instance, if I select “Infección por Clostridioides difficile,” only its corresponding HTML field should be shown, overriding the selection of “Historia de …”.

    Is there a way to achieve this?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author CodePeople2

    (@codepeople2)

    Hello @ohtusabes

    Thank you very much for using our plugin.

    The simplest solution would be using radio buttons instead of checkbox fields, which allow you to select one choice at a time.

    An alternative would be to use a calculated field as an auxiliary with an equation that contains conditional statements to evaluate the IGNOREFIELD or ACTIVATEFIELD operations.

    E.g., fieldname1 is the checkbox field. The |r modifier allows you to access the field raw values, and the |n tells the plugin you are referring to the field name instead of its value.

    (function(){
    if(IN('A', fielname1|r)) {
    IGNOREFIELD(fieldname2|n);
    IGNOREFIELD(fieldname3|n);
    }
    else{
    ACTIVATEFIELD(fieldname2|n);
    ACTIVATEFIELD(fieldname3|n);
    }
    })()
    Thread Starter PB

    (@ohtusabes)

    Hi @codepeople2

    Thank you very much for your advice.

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

The topic ‘Conditional in checkboxes’ is closed to new replies.