QF: setDefaults() weird behaviour
| From: | Martin Braun | Date: | Sun, 14 Nov 2004 20:39:12 +0000 |
| Subject: | QF: setDefaults() weird behaviour | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-15493@lists.php.net to get a copy of this message | ||
hey there,
I' having some trouble with setDefaults() at the mom. heres my code:
<code>
$form->setDefaults($defaults);
foreach ($editoptions as $id => $title) {
$form->addElement('checkbox', 'chk'.$id, null, $title);
}
</code>
so my form contains lots of checkboxes named chk0, chk1, chk2 and so on. $defaults looks like this: array('chk0' => true, 'chk1' => true).
the problem is: the checkboxes aren't checked by default - unless I reload the page (not submitting the form or anything, just reloading the page).
can anyone help?
thanks,
martin
--
/* no comment */
Please use my public PGP key: http://www.mbant.de/mbant-gpg-key