Re: HTML_QuickForm | trouble with checkboxes
| From: | Jeff MacDonald | Date: | Mon, 08 Dec 2003 23:29:56 +0000 |
| Subject: | Re: HTML_QuickForm | trouble with checkboxes | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-9389@lists.php.net to get a copy of this message | ||
On Tue, Dec 09, 2003 at 12:00:01AM +0100, Bertrand Mansion wrote:
>
> Did you try:
> $checkboxes[] =& $c;
>
yes, just tried it, and same result :(
I think this has something to do with the fact that I am making a group,
since when I break out the flags, it works fine.
-- snip --
$flags = array();
$flags[] = array("explicitlyrics", "explicit lyrics");
$flags[] = array("live", "recorded live");
$flags[] = array("remastered", "remastered");
$flags[] = array("limitededition", "limited edition");
$flags[] = array("specialedition", "special edition");
$flags[] = array("soundtrack", "sound track");
$group = array();
foreach($flags as $f)
{
$n = $f[0];
$l = $f[1];
$t = &HTML_QuickForm::createElement("checkbox", $n, null, $l);
if ($data[$n] == "f") $t->setChecked(False); else $t->setChecked(True);
$group[] = &$t;
}
$form->addGroup($group);
-- snip --
what this does is give me a group with all the boxes checked, when in fact
the opposite should be true-- they should be *unchecked*.
perpaps I am setting this up incorrectly?
regards,
J