Skip to main content
Participant
September 19, 2023
Question

Deactivate selections in a set of radial groups using a button and JavaScript

  • September 19, 2023
  • 3 replies
  • 420 views

Here is what I am looking to do.  I have a form that I built that must use Radial buttons for other functions but users can select an accedent a radial button and not have the ability to deselect it. I have things grouped into lets call them radial button famlies or groups.  For instance I have radial groups named Trucks1, Trucks 2, Trucks3 and another group or family named Cars1, & Cars2. Inside each group there would be a individual radial button for big, little, and small. 

 

I want a button that can deselect for all of Trucks and another button that can deselect for all of Cars.  It would be very helpful since I am new to this if you use trucks and Cars in your example to help me understand what I am doing correctly (or in this instance what I am doing incorreclty). 

 

 

Thanks!

This topic has been closed for replies.

3 replies

try67
Community Expert
Community Expert
September 20, 2023

As mentioned, using check-boxes might be a better idea, but if you want to stick with radio-buttons you can use this code to reset them when the button is clicked:

 

this.resetForm(["Trucks1", "Trucks 2", "Trucks3"]);

JR Boulay
Community Expert
Community Expert
September 20, 2023

You should use Checkboxes instead of radiobuttons, so the user can deselect a set.

To act like radiobuttons, the checkboxes must have exactly the same name and a different export value.

Acrobate du PDF, InDesigner et Photoshopographe
Bernd Alheit
Community Expert
Community Expert
September 20, 2023

Does you use radio buttons?