[Solved] How to ensure groups of radio buttons do not deselect each other in HTML? [closed]


The problem is that the radio groups in your HTML form have conflicting names. You’re using the following for all groups:

name="radio"

What you need to do is to use a different name for each group; in order words, use the same name for each question within a single group. Assuming your question IDs are integers, you could do something like:

name="radio_${examq.getQid()}"

That will ensure that each group exhibits mutually exclusive selection characteristics independently of the other groups.

8

solved How to ensure groups of radio buttons do not deselect each other in HTML? [closed]