Re: QuickForm: Unrelated Grouped Elements

From: Date: Thu, 20 Feb 2003 09:07:50 +0000
Subject: Re: QuickForm: Unrelated Grouped Elements
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-3851@lists.php.net to get a copy of this message
<dan@acucore.com> wrote : > I want to group a few elements on the same line that are unrelated (don't > share a name at all), but it appears that if I do this, it doesn't honor the > default values. > > Here's my code: > > $default['status'] = 2; > $default['approved'] = 't'; > > $form->setDefaults($default); > > $status = &HTML_QuickForm::createElement('select', 'status', > 'Status:', > $GLOBALS['conf']['status_keys']); > $status->updateAttributes(array('onChange'=>'setBgColor(this, > this.value)')); > $approved = &HTML_QuickForm::createElement('advcheckbox', 'approved', > null, 'Approved?', null, array('t','f')); > $form->addGroup(array($status, $approved), null, 'Status:'); > /* > $status = &$form->addElement('select', 'status', > 'Status:', $GLOBALS['conf'] > ['status_keys']); > $approved = &$form->addElement('advcheckbox', 'approved', null, > 'Approved?', > null, array('t','f')); > */ > > If I comment out the top portion and uncomment the bottom, it works, but it's > not quite what I want. > > I tried to figure out what the problems was to give a diff, but it's escaping > me. Try to give a name to your group instead of null, then modify your default array to reflect this change. This way, QuickForm will know where your elements are. Bertrand Mansion Mamasam

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