In my web app, I have a form with a bunch of bootstrap panels. In each panel I have 3 radio buttons and each radio button has a unique id but shares the same name with the other 2 radio buttons in the panel.
I would like to save all of the values of all the selected radio buttons in an array but there is a couple problems. If I decide to store the value of a selected radio button in an array as soon as the radio button is selected, I will face an issue if the user changes his mind and selects a different radio button in the same panel.
If that happens I will have to go into the array and replace the value that was added previously with the new value. Also everything is generated dynamically so the number of panels, the radio button ids, radio button names, etc. are not known ahead of time.
Is there a way to get all the values of all the selected radio buttons and save them in the array only when the form submit button is clicked using jQuery or raw Javascript?