I think I'd just use like

<input type="checkbox" name=box[1] value=1>
<input type="checkbox" name=box[2] value=1>
<input type="checkbox" name=box[3] value=1>
<input type="checkbox" name=box[4] value=1>

then you can loop through it with foreach($_POST[box] as $BoxID => $Value)
.. I assume the recieving script knows what boxes it expects?

-----Oorspronkelijk bericht-----
Van: Cesar Aracena [mailto:[EMAIL PROTECTED]
Verzonden: vrijdag 15 augustus 2003 20:38
Aan: [EMAIL PROTECTED]
Onderwerp: RE: [PHP] Checkboxes
Urgentie: Hoog


It could be a solution but only working with a few items. My list(s)
will be filled up with hundreds of items grabbed automatically out of
another MySQL table... would it help too? Maybe naming the checkboxes
with each item own ID... anyone?

Thanks,

Cesar Aracena
www.icaam.com.ar

> -----Mensaje original-----
> De: Matt Babineau [mailto:[EMAIL PROTECTED]
> Enviado el: Viernes, 15 de Agosto de 2003 12:34 p.m.
> Para: Cesar Aracena
> CC: [EMAIL PROTECTED]
> Asunto: Re: [PHP] Checkboxes
>
> You could try this:
>
> <input type="hidden" name="box1" value="0">
> <input type="checkbox" name="box1" value="1">
>
> So basically when it get submitted, you'll have either a 0 or 1
response
> to know whether or not it has been checked.
>
> Does this help?
>
> Matt
>
> On Fri, 2003-08-15 at 14:25, Cesar Aracena wrote:
> > Hi all,
> >
> > I am wondering what would be the best way to handle checkboxes. I am
> > making a site that will display several items in a 20-items-per-page
> > format and each item will have a checkbox next to it for the user to
> > select them. Now, what I need to do is to record the items selected
by
> > the user when clicking the Next button into a MySQL table. Should I
> > name all the checkboxes the same, using the item IDs as values and
then
> > use an array to see which ones where selected or maybe another
thing?
> >
> > Thanks in advanced,
> >
> > Cesar Aracena
> >  <http://www.icaam.com.ar> www.icaam.com.ar
> > Note: The information inside this message and also in the attached
files
> > might be confidential. If you are not the desired receptor or the
person
> > responsible of delivering the message, we notify you that it's copy,
> > distribution, keep or illegal use of the information it has it's
> > prohibited. Therefore we ask you to notify the sender by replying
this
> > message immediately and then delete it from your computer.
> >




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to