0

I have a problem with a WordPress website using radio buttons.

At the moment, there are 6 radio buttons, divided in 3 groups: group of 3, group of 2 and group of 1.

The groups have been made like this, because each group required a subtitle in front (in our context, it's a separation between youth, adults and competition playing). Putting all radio buttons in the same group doesn't allow putting the subtitles between the radio buttons.

But having the 3 groups doesn't allow us to enforce a control at registration to check if one of the three groups has been selected, as one of the 6 radio buttons should be selected (as in mandatory).

Has anyone a workaround to either: enable mandatory field check for the 6 radio buttons separated in 3 groups or a solution to put all radio buttons in one group, so mandatory field check is a breeze.

0

Have you thought about assigning different numbers to each of the radio buttons and have a minimum value when it returns? If it returns 0 or NULL then display a message? So youth group could be something like.

YOUTH

[checkbox] 5 - 8 (value 1)
[checkbox] 9 - 12 (value 2)
[checkbox] 12 - 16 (value 3)

etc you get the point.

That way if it returns 2 then you know it's the 9-12 group. You could store any of the checkbox group results to the same variable and check that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.