Set attribute on select option with Zend_Form
Today I needed to disable a few options in a status select box when building a Zend Framework application.
Luckily this is very easy to do, but you just have to know how.
Make sure you set all available options first:
Below that line you can set an attribute on some options. For example, if you want to disable the first, second, and fith option in the select box:
And you’re done!
This entry was posted by Pieter Vogelaar on October 10, 2011 at 13:05, and is filed under Zend Framework. Follow any responses to this post through RSS 2.0.You can leave a response or trackback from your own site.
About Pieter Vogelaar (60 posts)
Hi, my name is Pieter Vogelaar. I’m a web developer / DevOps engineer / IT consultant and specialized in high traffic and high profile websites. I love open source and have a great passion for automating and developing things!
Thanks for sharing this ZF knowledge Pieter!
You just saved me from creating a custom element, thx for this brilliantly simple solution!