You are viewing limited content. For full access, please sign in.

Question

Question

Is there way to drop the value of a radio button when the field becomes hidden

asked on January 9, 2023 Show version history

We have a complex form with a lot of radio buttons that are dependency driven.  However, once the user selects an answer they can only change it, not clear it out.  If the field becomes hidden because of a change in a previous radio button answer, other radio buttons get hidden but they hold their value which then messes up any formulas or show/hide rules.  We would like the radio buttons to drop their value if they become hidden.

0 0

Answer

SELECTED ANSWER
replied on January 9, 2023 Show version history

The only way to do this would be via JavaScript. HTML radio buttons aren't really meant to be "cleared" entirely, unlike checkboxes, so it takes a bit more to accomplish (i.e., this is an HTML design standard, not a Laserfiche-specific behavior).

This is a scenario in which we typically leverage Sections and more complex field rules/formulas.

For example, if I had a field like "Send a reminder - Yes/No" and selecting "Yes" shows a field for entering the recipient email address, that works fine in simple scenarios.

However, if the "send a reminder" option is only available for specific selections made earlier in the form, like a specific request type, then I would wrap both the "send reminder" and "recipient" fields inside of a "reminder" section.

Then, I would set a field rule on the Section so even if "send reminder" was still set to "yes" neither of those fields would be displayed when a previous selection causes the entire section to be shown.

Similarly, I would set up IF conditions in my formulas/calculations.

For example  IF(Type="Request",Send_Reminder,"")

So If the "type" is applicable, it'll use the variable, but if not, it will ignore it even if it remains filled.

0 0
replied on January 10, 2023

Thank  you Jason.  I have set a lot of rules based on the outcomes of formula functions to get around some of these things and most of the time it works really well when there are too many "ifs" for the Field Rules.  However, in this case, there are so many outcomes where they could go back and forth on their answers and dropping the value on the hide seemed a lot easier.  

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.