multiple checkbox

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
milleusi
Forum Commoner
Posts: 30
Joined: Mon Jun 13, 2005 3:18 am

multiple checkbox

Post by milleusi »

i need th number, values of my checkboxes. where is the problem?

select id from.....
.....
echo"<input type='checkbox' name='id[]' value='".$row['id']."' >";
......

i need all the checkbox values in a POST, but i get them only when are checked.


thx
User avatar
wtf
Forum Contributor
Posts: 331
Joined: Thu Nov 03, 2005 5:27 pm

Post by wtf »

why do you need them all?
milleusi
Forum Commoner
Posts: 30
Joined: Mon Jun 13, 2005 3:18 am

Post by milleusi »

in fact i'm interested by the index of the checked box
milleusi
Forum Commoner
Posts: 30
Joined: Mon Jun 13, 2005 3:18 am

Post by milleusi »

i need to send more values with the checked box. How to do that?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

you'll need to loop over the checkbox array on the php side to net out all of the values.

use a foreach loop to do that.
Post Reply