10 years ago
5
Topic
Good day, frends.
Little and simple question - how can I add "disabled" attribute to one option of select?. Simple Select for example.
Get a Book for SEBLOD
178 Posts
Jeka
10 years ago
1
Level 1
Did you try to use Custom Attributes for that? 
10 years ago
0
Level 2
Of course. This is reason of my question. I need SINGLE attribute for ONE option, but custom options don't support single attripute - I can apply it for all options (if I type it in bottom field group) or couple of attribute attr_name="attr_value"
178 Posts
Jeka
10 years ago
1
Level 1
Ok. I now i see.
For example you can set "id" in custom attributes and add some id ( disabled_option ) for your option which you want to make disabled. In "Script (JS)" in stuff section of this field put document.getElementById('disabled_option').disabled = true;
10 years ago
0
Level 2
Yeah, thanks, bit as I seem it have to be standart function. I read a code of field - it is one little condition. Maybe my message should be in tracker, but I see not a bug but annoying ommision...
10 years ago
0
Level 1
While developers are busy to read forum we can save us byself. 
http://yadi.sk/d/rlI2U3_wLExT3 - you can download advanced version of Simple Select. In this version I added "clear" value support. If options value is clear, attribute isn't shown. 
Thanks to all.
Get a Book for SEBLOD