开发者

how can set radio buttons horizontally in zend form

hi i am using zend form , i created a

Zend_Form_Element_Radio element

that have two options

yes , no

in my form it shows vartically ,one button below the other . i want to add them horizontally .

this is my radio button code

    $radio = new Zend_Form_Element_Radio('yes');
    $radio-> setLabel('Are you booking for someone else ?');
    $radio->addMultiOptions(array('yes','no'))开发者_如何学JAVA;
    $radio->setDecorators(array(
                                array('ViewHelper',
                                            array('helper' => 'formRadio')
                                ),
                                array('Label',
                                            array('class' => 'label')
                                ),
                             )
                        );  

can i view them horizontally ?? please help ?


Did a quick search, maybe this post will help?

Display Zend_Form_Element_Radio on one line

From the old answer:

You need to call the setSeparator method on the Zend_Form_Element_Radio object, passing it ''.

Good luck!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜