You need to sign in to do that
Don't have an account?
lopezc
Once selected, radio buttons cannot be deselected
Hi
I am using radio buttons in my VF page. I noticed that you can change the selection, but not deselect any from being chosen. Is this unavoidable?
That is the function of a "radio" button when used separately. You can use them in a Radio button group where a bunch of radio buttons toggle when once of the radio buttons in the group is selected.
With that said, you could use a javascript function to "deselect" the radio button or set the value to "false" in the controller.
not sure how I can set the value to false in the controller, when the radio button is selected the controller is not called unless I press "submit" the form... I just need some kind of event to let the user to deselect the radio button... nothing to do with the controller...
could you paste an example with Javascript? Thanks!
isn't this by nature in regards to radio buttons? i've never seen a standard HTML form with these that didn't have this limitation. we always worked around it by using a control of custom stylized checkboxes that were made to look like radio buttons.