The value that will be passed for a specific group when the form is submitted will be the value of the button within the group that is selected at the time that the form is submitted.
In the case of a checkbox multiple values can be selected so validation is done if none of the checkboxes are ticked.
The desired behavior we want is to have only one button selected at a time; when one button is selected then any previously selected button will be automatically deselected.
The creation of multiple groups of radio buttons for the one form is also straightforward.
This is a bit tricky first we need to check if none of the radiobuttons are checked then display a message.