Re: QuickForm: setting checkbox when editing
| From: | Justin Patrin | Date: | Fri, 20 May 2005 04:04:33 +0000 |
| Subject: | Re: QuickForm: setting checkbox when editing | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-19291@lists.php.net to get a copy of this message | ||
On 5/18/05, Nola <nola@devasap.com> wrote:
> I tried to search before sending this, so I'm sorry if I could not find
> where this has been said before.
>
> I am using the form to edit, so I use the form->setDefaults($array) to
> set the form fields with the data to edit, but I don't know how to set
> the checkboxes.
>
> Do I need to check the value of my variable and if == 1, then set the
> attribute "checked" for the checkbox?
>
setDefaults should work fine. If it doesn't, try using setChecked on
the checkbox.
--
Justin Patrin