For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > February 2006 > Creating checkbox list.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Creating checkbox list.
Jeff Broomall

2006-02-21, 9:55 pm

Good evening.

I'm sure this is something easy so I'm hoping you can simply steer me to a
good source.

I simply need to create a Checkbox list using data from my "groups" table.

I have a table with two fields:
1) groups_id
2) groups_name

The data contained is simple:

groups_id groups_name
----------- ----------------
1 Group A
2 Group B
3 Group C
4 Group D

I would like to dynamically create a checkbox selection similar to:

<input name="sel_group[]" type="checkbox" value="1">Group A<BR>
<input name="sel_group[]" type="checkbox" value="2">Group B<BR>
<input name="sel_group[]" type="checkbox" value="3">Group C<BR>
<input name="sel_group[]" type="checkbox" value="4">Group D<BR>

So I need a script that'll take this information from the groups table
and create the above. Can you help?

As I look at this, I believe I'm going to need to create an array for my
final "report." So I just added the [] after sel_group.

Thanks.

Ward
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com