Re: form question
| From: | Monte Ohrt | Date: | Wed, 19 Jul 2000 14:11:48 +0000 |
| Subject: | Re: form question | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-7269@lists.php.net to get a copy of this message | ||
If you don't pass a value, then you have no idea which ones were
actually checked. You only know how many were checked. If none are
checked, then nothing is passed. Another option is a radio button so
there is always a value either way.
"Martin A. Marques" wrote:
>
> Nothing changed with the value attribute. Also the value attribute is not
> that necesary, because if I uncheck the checkbox, it's not loaded.
> What I found out is that the variable ar_pru is defined but empty if one or
> more checkboxes are checked, but is not defined if all checkboxes are
> unchecked.
> So, if the variable is set, and something is passed to the next script by the
> form, why is it empty? Or does it have something I cant see?
>
> On Wed, 19 Jul 2000, you wrote:
> > None of your checkboxes have a value attribute.
> >
> > "Martin A. Marques" wrote:
> > >
> > > Actually my "test" form looks like this:
> > >
> > > <form action="prueba-resultado.php" method="post">
> > > <input type="checkbox" checked name=ar_pru[]><BR>
> > > <input type="checkbox" checked name=ar_pru[]><BR>
> > > <input type="checkbox" checked name=ar_pru[]><BR>
> > > <input type="submit" value="Go!">
> > > </form>
>
> --
> "And I'm happy, because you make me feel good, about me." - Melvin Udall
> -----------------------------------------------------------------
> Martín Marqués email: martin@math.unl.edu.ar
> Santa Fe - Argentina http://math.unl.edu.ar/~martin/
> Administrador de sistemas en math.unl.edu.ar
> -----------------------------------------------------------------
--
Monte Ohrt <monte@ispi.net>
http://www.ispi.net/