Disable enable select option javascript

By: NAO Date: 27.06.2017

Welcome to WebmasterWorld Guest from I have the following select menu: I'm wondering if it's possible to write some javascript at the bottom of the page that will do the disabling for me.

HTML option disabled Attribute

Am I not doing this right, or is this not even possible? July 21, posts: June 17, posts: I can pass it a single array and set some basic "select level" options, like class, but I can't pass it "option level" items. Hence wanting to do this outside of the select itself. I know this is a dirty hack and there must be a better way of doing this in ZF, but I'll be dammed if I can find out how.

Shall I take it that this isn't possible do do with javascript? Mar 22, posts: Your other option would be to simply use two separate select dropdowns.

JavaScript is too unreliable, as it can be disabled by the client. Aug 10, posts: Oct 17, posts: June 12, posts: Now, I can but wonder what a disabled optgroup looks like! Become a Pro Member.

disable enable select option javascript

Terms of Service and Privacy Policy. All trademarks and copyrights held by respective owners. Member comments are owned by the poster. WebmasterWorld is a Developer Shed Community owned by Jim Boykin.

Forum Index Supporters Forums Tools All SEO Tools All Social Tools All Webmaster Tools All Free Tools Pro Membership Recent Posts Open Posts Resources Library Announcements Hire Register Login Search Search.

This page requires javascript to function properly. It seems disable enable select option javascript your browser does not have Javascript enabled. Message Too Old, No Replies How to disable select options go easy on me! How to specify certain options in a select menu, without effecting all of them Both of them sound like good ideas. Also note that you have two options valued "re" - that could cause some problems.

HTML DOM Select disabled Property

How about changing apple to "ap"? Mar 15, posts: I am not familiar with the zend framework either, but I would be very surprised if value selected dropdown jquery did not have a defined method for handling option groups.

Thanks for all the replies. Yes, that is valid.

disable enable select option javascript

From phranque's link above: The following elements support the disabled attribute: BUTTON, INPUT, OPTGROUP, Stock exchange listed companies in chennaiSELECT, and TEXTAREA. I did not think this functionality existed. And I find myself corrected as well: Now I can use optgroup Stock market gujarati news paper don't have to worry about the disabled part.

I was asking about that because I didn't want the group heading fruit, color to be selectable. Become a Pro Member Join The Conversation Register For Free! Firefox 54, Faster, Less Resources Snapchat Now Offers Self-Serve Advertising With Snap Publisher Tool Instagram Clamps Down on Bots and The Companies Running Them Bing Image Search Removal Seems Slow Upgrade to HTTPS - Use Relative vs.

html - How can I disable an