Re: Re: QuickForm: Multiple types in same group same line?

From: Date: Thu, 02 Oct 2003 20:52:25 +0000
Subject: Re: Re: QuickForm: Multiple types in same group same line?
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-8242@lists.php.net to get a copy of this message
Ahhh I think I'm getting there. But I've been wresteling with a bug for the last couple hours. Basically I'm doing while($row = $result->fetchRow()) { quickforms stuff... } I'm able to pull stuff from the db (using Pear::DB) and populate the rows with the data, excet for the radio buttons. I either get the first rom looking fine, then each row after that incrementally showing more and more raido buttons. Or I only show one raido option and that's it. Here's what i"m doing. $form = new HTML_QuickForm("$row[0]", 'GET'); $renderer =& $form->defaultRenderer(); $defaultValues['id'] = array('trackingid'=>"$trackingid", 'emtype'=>"$emtype"); $id['trackingid']->setSize(4); $id['emtype'] = &HTML_QuickForm::createElement('radio', 'emtype', 'Test', null, '1'); $id['emtype'] = &HTML_QuickForm::createElement('radio', 'emtype', 'Seed', null, '2'); $id['emtype'] = &HTML_QuickForm::createElement('radio', 'emtype', 'Both', null, '0'); $id['sent_test'] = &HTML_QuickForm::createElement('submit', 'seeds.php', 'Send Test'); It's weird becuase only the raido buttons have the problem. WHen I do $id[] that's when I get the repeat problem. When I do $id['emtype'] that's when I get the looping problem with repeating radio buttons. Thanks for any suggestions. Keith Bradley Batt wrote:
Header1 DrowDown Header3 CheckBox [.....] [dropmenu] [.....] Y[] N[] [.....] [dropmenu] [.....] Y[] N[] [.....] [dropmenu] [.....] Y[] N[] [.....] [dropmenu] [.....] Y[] N[] [.....] [dropmenu] [.....] Y[] N[] I'd love to see any examples if anybody has any.
Try something like this: $g_buttons[] = & $this->createElement('submit', $this->getButtonName('next'), 'Save Changes'); $g_buttons[] = & $this->createElement('submit', $this->getButtonName('cancel'), 'Cancel'); $this->addGroup($g_buttons, 'buttons', null, ' ', FALSE); And substitute whatever type for "submit" that you like. The example above puts two submit buttons on the same line. You can do the same thing with a select and checkboxes, etc. like you have in your example above. - Brad


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