1

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

hungneox
  • 8,623
  • 10
  • 47
  • 64

2 Answers2

1

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

b.b3rn4rd
  • 8,086
  • 2
  • 40
  • 54
0

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

Community
  • 1
  • 1
enenen
  • 1,959
  • 2
  • 17
  • 32