There are a few options for unchecking radio buttons. Some were already mentioned, such as resetting the radio button group and using check boxes as radio buttons.
Here is an article on how to use a checkbox as a radio button, there's even a sample:
I see this response is more than two years old. I hope that you are still listening. 🙂
I presume that in "this.getField("RadioGroup").value = "Off";" refers to the name of the group. Also, I have added this code to the javascript for my "Reset Form" button. Doesn't seem to work. Any thought?
You're correct, but this would apply as long as the radio button group is mutually exclusive (same field names but different export values; will make the radio buttons behave like checkboxes independent from each other), otherwise the whole group of radio buttons will be checked or unchecked in unison by tjust checking one of them alone.
When you use a group of mutually exclusive radio buttons you'll also may need to emply a zero-based index workflow in your script(s) to work with each radio button individually.
Radio buttons are indexed in the order that they were created.
That said, if you have three of them in the same array, and each radio button has the same field name as "RadioGroup", then the zero based-index workflow would look something like:
this radio button is the first one in the Array --->>> this.getField("RadioGroup").isBoxChecked(0);
this radio button is the second one in the Array --->>>this.getField("RadioGroup").isBoxChecked(1);
this radio button is the third one in the Array --->>>this.getField("RadioGroup").isBoxChecked(2);
As for your reset button you don't really need a code to reset them all since you can use tha built-in Mouse-up event "Reset a Form" and just select from the picklist which radio buttons you want to clear..
But if you still want to use JavaScript you can do the same as a Mouse-up javascript action with:
var f = this.getField("RadioGroup");
this.resetForm([f.name]);
Radio Buttons can't be unchecked. The solution I found from another trend is to use a check box but in order to work like a radio button is to make sure all the boxes has the same name except for the value. Value i used for 6 check boxes are numbers 1-6, all have the same name..Works like a charm...
This is a limitation of radio buttons. To allow the user to cancel a “real” selection he has made, you can include a radio button that corresponds to a null choice, like “Do not know” or “No answer”. If you want a single button that can be checked or unchecked, use a checkbox.