Problem with radio buttons and HTML_QuickForm

From: Date: Mon, 06 Dec 2004 07:53:38 +0000
Subject: Problem with radio buttons and HTML_QuickForm
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-16034@lists.php.net to get a copy of this message
Hello list, I have a problem with radio buttons which I was not able to solve myself yet. When I do the following in my subclass's HTML_QuickForm_Page::buildForm():
       $this->addElement('header', null, 'Der Text ist interessant und motiviert zur weiteren Arbeit.');
       $this->mkRadios1('motivation_radio');
...where mkRadios1() is the following:
       protected function mkRadios1($name)
       {
           $radios[0] =& $this->createElement('radio', $name, '', 'trifft voll zu', 4);
           $radios[0]->setChecked(false);
           $radios[1] =& $this->createElement('radio', $name, '', 'trifft zu', 3);
           $radios[1]->setChecked(false);
           $radios[2] =& $this->createElement('radio', $name, '', 'weiß nicht', 2);
           $radios[2]->setChecked(false);
           $radios[3] =& $this->createElement('radio', $name, '', 'trifft eher nicht zu', 1);
           $radios[3]->setChecked(false);
           $radios[4] =& $this->createElement('radio', $name, '', 'trifft gar nicht zu', 0);
           $radios[4]->setChecked(false);
                     $this->addGroup($radios, $name.'Group', '', '&nbsp', false);
       }
The last button always gets a checked="checked". Same problem without QuickForm_Controller. I think it's a problem with the group. Same problem with radio button's name set to null and only the group name set. How can I remedy this problem? Any hints? Kind regards and a plea for CC, Leslie

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