hungneox
hungneox

Reputation: 9829

Zend framework - How to enable options in select box

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); ?

Upvotes: 1

Views: 383

Answers (2)

enenen
enenen

Reputation: 1967

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

Upvotes: 0

b.b3rn4rd
b.b3rn4rd

Reputation: 8830

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

Upvotes: 1

Related Questions