Re: form question
| From: | Meir Kriheli - MKsoft | Date: | Wed, 19 Jul 2000 15:06:23 +0000 |
| Subject: | Re: form question | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-7266@lists.php.net to get a copy of this message | ||
It's recomended to place the name of the var in quotes too.
e.g.
<input type="checkbox" name="fila_art[]" value="value1">
Also the echo(sprintf(.......)); is redundant. instead use
printf(.......);
Meir Kriheli
MKsoft computer systems
'There's someone in my head but it's not me" - Pink Floyd
----- Original Message -----
> It should be an array of values. On the form the html should look like:
>
> <input type="checkbox" name=fila_art[] value="value1">
> <input type="checkbox" name=fila_art[] value="value2">
> <input type="checkbox" name=fila_art[] value="value3">
>
>
> Then once the form is submitted, the values should be accessible
> with $fila_art[0], $fila_art[1], etc... be careful about
> variable scope, $fila_art will be undefined within a function
> if it isn't passed or made global.
>
> Monte
>
> "Martin A. Marques" wrote:
> >
> > On Tue, 18 Jul 2000, Monte Ohrt wrote:
> > > Ok, so would this work for you?
> > >
> > > echo(sprintf("<input type=\"checkbox\" name=fila_art[]
> > > value=\"%s\"
> > > checked>",
> > > $fila_art[a_id]);
> > >
> > > Then you could just traverse the fila_art[] array in your php script.
> >
> > OK. I tried this after other trys, but when the action script is
executed,
> > fila_art is not defined. I'm clueless at this time! %-<
> >
> > Saludos... :-)
>