Re: Pb with checkbox

From: Date: Thu, 18 Apr 2002 09:58:59 +0000
Subject: Re: Pb with checkbox
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-93503@lists.php.net to get a copy of this message
Ok, thanks ----- Original Message ----- From: "Jason Wong" <php-general@gremlins.com.hk> To: <php-general@lists.php.net> Sent: Thursday, April 18, 2002 11:31 AM Subject: Re: [PHP] Pb with checkbox > On Thursday 18 April 2002 17:19, Frédéric Mériot wrote: > > Hello, > > I've got a little pb with checkboxes. In my form I've got 5 checkboxes > > which have the same name "sel". When I submit the form and when I display > > the form variable "sel", it displays the last value only. I cannot catch > > all the value checked in the form. > > > > If I try this code with coldfusion or ASP it displays a coma delimited list > > of all the values I checked in the form. > > > > How to fix this pb with PHP? > > > > My code: > > > > <!--- the form ---> > > <form action="catalog.php" method="post"> > > <table border="0" cellspacing="0" cellpadding="0"> > > <?for ($i=1;$i<=$nb;$i++){ > > <tr> > > <td align="center"><input type="checkbox" > > name="sel" > > Name your checkboxes like: > > name="sel[]" > > In your script you would have access to an array called $sel which contains > the values of your checkboxes. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > Life does not begin at the moment of conception or the moment of birth. > It begins when the kids leave home and the dog dies. > */ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#93503) next »