Re: PEAR:HTML_QuickForm : radio element

From: Date: Wed, 01 Oct 2003 15:19:57 +0000
Subject: Re: PEAR:HTML_QuickForm : radio element
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-8185@lists.php.net to get a copy of this message
<ddemacek@doneasy.com> wrote : > Hello, > > I'm trying to add 'checked' to the first radio element any ideas on how > to do that? > > I've noticed there is setSelected() but can't figure out how to use it. > > $memb=array(); > $memb[] = &HTML_QuickForm::createElement('radio', null, null, 'YES', > '1'); > $memb[] = &HTML_QuickForm::createElement('radio', null, null, 'NO', > '0'); > $form->addGroup($memb, 'cookie', 'Would you like a cookie?:', > '<br > />'); > > Thanks. Dan. Use $form->setDefaults(array('cookie'=>'NO')); Look in the documentation for setDefaults too. Bertrand Mansion Mamasam

« previous php.pear.general (#8185) next »