0
votes

Hi I am new in zend framework. I want to disable my select box when my status value(from database) is 0. Basically I don't know the syntax Please help me. This is my select box code:

$sub= new Zend_Form_Element_Select('subject',array( 

            'id'        => 'sub',
            'required'   => true,
            'filters'    => array('StringTrim'),
            'multiOptions' => array(
            '0'    => '---Select---',

        ),
            'style'    => array('width:103px'),
            'value'   =>  $sub_val,
            'decorators'=>Array(
            'ViewHelper','Errors'
           ),
        ));

$subject_values->addMultiOption('subject1','test');
$this->addElement($subject_values)
1

1 Answers

0
votes

$sub->setAttrib('disabled','disabled'); will disable the select box subject