For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > May 2007 > Re: [PEAR] Html Quckform constructor









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR] Html Quckform constructor
Justin Patrin

2007-05-22, 7:02 pm

On 5/22/07, Atif Khan <wequar98@gmail.com> wrote:
> I am trying to create a checkbox, but I cannot seem to
> have the check in there by default. What am I doing wrong.
>
> $form_obj->addElement('checkbox', 'chkTerms', "Blah Blah",
> array("setChecked" => 1));
>
> Is this correct ?
>


Use $form_obj->setDefaults(array('chkTerms' => 1));

--
Justin Patrin
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com