radio button array?

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
jaymoore_299
Forum Contributor
Posts: 128
Joined: Wed May 11, 2005 6:40 pm
Contact:

radio button array?

Post by jaymoore_299 »

I have an interactive database manager with each row displayed with 3 options so that only one option can be chosen of the 3, by way of radio buttons. I need an easy way to have all the information put into one array for processing.

right now I have it as:
"radio button name(ex: radio1)"="value (ex: 1)"
row1 data.. radio1=1
row2 data.. radio2=3
row3 data.. radio3=2
row4 data.. radio4=1

I know that checkboxes can be stored as arrays, can the same be done for radio buttons?
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

Code: Select all

<input type="radio" name="radio1" value="1" />
<input type="radio" name="radio1" value="2" />
<input type="radio" name="radio1" value="3" />
<input type="radio" name="radio1" value="4" />

Code: Select all

echo $_REQUEST['radio1'];
Post Reply