Re: QF: setDefaults() weird behaviour
| From: | Trevan | Date: | Mon, 15 Nov 2004 06:05:34 +0000 |
| Subject: | Re: QF: setDefaults() weird behaviour | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-15501@lists.php.net to get a copy of this message | ||
I don't know if this helps, but I was having a similar problem, where the radio buttons switch spots after reloading or they dissapear (meaning the selection). For me, the problem turned out to be with PHP session handler. I had to change some of the ini settings with the session and it fixed it. To see if you have the same problem as mine, just create a plain html file that has a form and some radio buttons, (one needs to be default). Then place session_start at the beginning of the file. If the radio buttons act strange by refreshing the page, then my guess is the ini file.
Hope this helps,
Trevan
Martin Braun wrote:
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