I am using zend form to create an radio button element. How do I align them horizontally.
$this->addElement('radio', 'howYouFeel3', array(
'onClick' => 'showFields(this);',
'required' => true,
'multiOptions' => array(
'Positive' => 'Positive',
'negative' => 'Negative',
)
));
I have tried adding:
'setSep' => '',
and
'separator' => '',
and
'setSeparator' => ''
But none worked.
Also tried:
$howYouFeel3 = new Zend_Form_Element_Radio('howYouFeel3');
$howYouFeel3
->setLabel('How you Feel?')
->setSeparator('')
->addMultiOptions(array(
'positive' => 'Positive',
'negative' => 'Negative'
));
$this->addElement($howYouFeel3);
Have looked at the source code and it seems the code is creating the radio buttons in li tags in an ul unlike others in the situation with the same problem who have an
at the end. This is perhaps why the seperator thing doesnt work.
您可以使用setSeperator函数对齐单选按钮
$radio= new Zend_Form_Element_Radio('status');
$radio->setSeparator(' ');
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.