I’m using Bootstrap css and js in my application. Accidentally I clicked on a disabled Dropdown list and found that it’s opening the dropdown. I have made it readonly in the attribute of the select element:
<select id="xxx" name="xxx" class="input-medium" readonly>
I have also tried setting readonly="true", but still the same.
However, textbox control works fine, if you don’t use jQuery.datepicker.
Is there a special way of making a dropdown control readonly when we use bootstrap?
No, Bootstrap does not introduce special considerations for disabling a drop-down.
or
will work. I prefer to give attributes values (as in the second form; in XHTML, attributes must have a value), but the HTML spec says:
(from http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#boolean-attribute)
The key differences between read-only and disabled:*
The Disabled attribute
method. The W3C calls this a successful element.(This works similar
to form check boxes that are not checked.)
or provide default styling for disabled form elements. (Gray out or
emboss text) Internet Explorer 5.5 is particularly nasty about this.
are skipped in tabbing navigation.
The Read Only Attribute
<SELECT>,<OPTION>, and<BUTTON>elements do not have readonly attributes (although thy both have disabled attributes)*-blatant plagiarism from http://kreotekdev.wordpress.com/2007/11/08/disabled-vs-readonly-form-fields/