number of radio button

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bumbar
Forum Newbie
Posts: 1
Joined: Mon Nov 24, 2008 4:25 am

number of radio button

Post 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?
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: number of radio button

Post by VladSun »

Try

Code: Select all

print_r($_GET);
and you'll see what you need to do.
There are 10 types of people in this world, those who understand binary and those who don't
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: number of radio button

Post 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.
Post Reply