How to deselect a radio button option?

Certified Lead Developer

Hello,

We have a use case where user needs to select only one option out of multiple options. It is not a mandatory field. Radio button helps in ensuring only one option is selected. However, it doesn't allow user to deselect the option. We tried to set the value of Radio button as null when user is selecting the same option again. But it didn't work.

Hence, we are currently using multiple checkbox fields to handle this use case.

Is there a better approach to handle this scenario?

 

Thanks in advance.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    While I applaud the creativity of a lot of the other solutions people have provided, radio buttons aren't meant to be deselected per web standards. Before utilizing a workaround consider how this will impact end users who are use to utilizing radio buttons on many other web interfaces. Additionally, think of the potential burden on future developers that may need to maintain this behavior and figure out what was done.

    I would suggest utilizing a different field type, as you already mentioned.
Reply
  • 0
    Certified Lead Developer
    While I applaud the creativity of a lot of the other solutions people have provided, radio buttons aren't meant to be deselected per web standards. Before utilizing a workaround consider how this will impact end users who are use to utilizing radio buttons on many other web interfaces. Additionally, think of the potential burden on future developers that may need to maintain this behavior and figure out what was done.

    I would suggest utilizing a different field type, as you already mentioned.
Children
No Data