Validating radio button with php
HTML select tag allows user to choose one or more options from the given drop down list.
Below example contains PHP script to get a single or multiple selected values from given HTML select tag.
If you want to output an error to right below the radio buttons, then just move the PHP logic/output to right after the radio buttons.
Without seeing your create_form_input function, it's hard to comment beyond that, but I imagine that the create_form_input function is indeed the problem with your code.
This is different from the other types of input, which will always post at least something, no matter what.
We are covering following operations on select option field using PHP script.
The first thing you should do is test whether any radio buttons are selected or not with the isset function.
Unfortunately, I think this is something you're going to have to debug on your own, as we're not going to take the time to look through all your code.
margaux was the one that mentioned using HTML entities (e.g., ) in your HTML.