Page 1 of 1

number of radio button

Posted: Mon Nov 24, 2008 4:39 am
by bumbar
Hallo!


I have a form with radio buttons:

Code: Select all

 
<form action="" method="get">
<input name="v" type="radio" value="Bob" />Bob
<input name="v" type="radio" value="Steve" />Steve
<input name="v" type="radio" value="Peter" />Peter
<input name="v" type="radio" value="Ivan" />Ivan
<input type="submit" name="submit" value=submit">
</form>
 
How can I get the number of radio button that is pressed?

Re: number of radio button

Posted: Mon Nov 24, 2008 4:56 am
by VladSun
Try

Code: Select all

print_r($_GET);
and you'll see what you need to do.

Re: number of radio button

Posted: Mon Nov 24, 2008 5:10 am
by aceconcepts
The number of radio buttons clicked will always be one because your using radio buttons all with the same name. If you want multiple selections use checkboxes instead.