• Resolved PB

    (@ohtusabes)


    Hi @codepeople

    I would like the result to appear in the calculated field (fieldname5) only when all radio button options have been selected. I’ve partially accomplished this—currently, the result disappears when a “0” value is selected in any radio button. However, I suspect the issue arises because unselected options also default to a value of “0”, making it difficult to distinguish between an intentional “0” selection and an unselected field. Could you help me resolve this?
    The equation I´m using is:

    IF(
    AND(
    fieldname3 != "",
    fieldname6 != "",
    fieldname14 != "",
    OR(fieldname12 != "", fieldname15 != "")
    ),
    fieldname3 + fieldname6 + fieldname14 +
    IF(fieldname12 != "", fieldname12, fieldname15),
    ""
    )

    Thanks in advance.

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

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

    (@codepeople2)

    Hello @ohtusabes

    In your specific case, a better alternative is to compare with the |v modifier, to use exactly the field’s value that would be submitted, and the !== used in JavaScript to compare the exact value.

    IF(
    AND(
    fieldname3|v !== "",
    fieldname6|v !== "",
    fieldname14|v !== "",
    OR(fieldname12|v !== "", fieldname15|v !== "")
    ),
    fieldname3 + fieldname6 + fieldname14 +
    IF(fieldname12|v !== "", fieldname12, fieldname15),
    ""
    )

    Best regards.

    Thread Starter PB

    (@ohtusabes)

    Hi @codepeople2

    Yes, it worked perfectly.

    Thank you!

    Thread Starter PB

    (@ohtusabes)

    Hi @codepeople2

    I’m using the same topic (unless you think it would be better to open a new one), since it’s related to the original issue.
    The result is correctly hidden until a radio button is selected, which is the expected behavior.
    I’ve also set up dependencies that work fine — except when the value is 0. In that case, fieldname10 is supposed to be displayed when the 0 option is selected. However, fieldname10 is also being displayed when no radio button is selected.
    The form I´m working on is: https://app.ucimhef.org/?cff-form=105

    Is there a way to solve this?

    Plugin Author CodePeople2

    (@codepeople2)

    Hello @ohtusabes

    Please click on the link to enter the validation rule manually, and enter a validation rule that do not allow ambiguity:

    value|r===0

    Please look at the screenshot image:

    Best regards.

    Thread Starter PB

    (@ohtusabes)

    Hi @codepeople2

    Sorry for the delay. It is working perfectly now.

    Thank you!

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

The topic ‘Calculated field with radio buttons’ is closed to new replies.