View Full Version : radio buttons required needed!

03-16-2004, 10:31 AM
How can i check if the user selected a real value, and not leave the radio buttons?

<input type="radio" value="1" checked name="payment">

// AND

<input type="radio" value="2" checked name="payment">

The radio button is my first time to use it. I never try it with validation.

How do you take off 'no black spot on it'!?!
The user must select! If he/she leave it on then it'll be required validation!


if ($_POST['whatever'] == '1,2'){
echo 'you need to select a whatever !.';

That don't work :(

I know how to code php required field validation in only one time but not two radio buttons.


03-16-2004, 11:40 AM
I don't understand.

What exactly are you trying to do?

How do you take off 'no black spot on it'!?!
:confused: Do you mean tou want to display the radiobuttons without them being checked? then just remove the checked
--><input type="radio" value="1" name="payment">

And to see which one they seleced, it's just

if (!isset($_POST['name']) or ($_POST['name']) < 1)){
echo 'you need to select a whatever !.';

03-16-2004, 02:25 PM
wicked, thanks