1
votes

I use this piece of code to disable options of a select box in Zend Framework:

$this->getElement('selectbox')->setAttrib('disable', $disabled_options);

But I don't know how to re-enable them or clear these attributes by php code. Could you please tell me how can I achieve this goal?

Is there any method like setAttrib('enable', $options); ?

2

2 Answers

1
votes

I assume you are using 'disabled' attribute... then to remove it use unset($this->getElement('selectbox')->disabled);

0
votes

Maybe it is better to just remove unnecessary options: https://stackoverflow.com/a/878331/1333512
Demo