Zend Form: Checkbox element displays as hidden field?

后端 未结 6 1867
春和景丽
春和景丽 2021-02-20 08:34

I would like to add a simple check box to my form:

$element = new Zend_Form_Element_Checkbox(\'dont\');
$element->setDescription(\'Check this box if you don\\\         


        
6条回答
  •  不要未来只要你来
    2021-02-20 09:20

    You can add an attribute disableHidden to the checkbox form element which prevents it from adding a hidden field while rendering.

    $chk = new Zend_Form_Element_Checkbox('test_checkbox');
    $chk->setAttrib('disableHidden', true);
    

提交回复
热议问题