I was creating some form when I saw that in Firefox. In a select box, if you add a disabled option as first choice... it select the next available option
<option disabled="disabled" value="false">Choose option</option>
<option value="1">Value 1</option>
It will select "Value 1" when the page is loaded.
Why every browser will select the disabled one by default and Firefox not?
Load this in Firefox : http://jsfiddle.net/6WjgZ/1/
and other browser you'll notice that Firefox bypass the disabled one and select the "Value 1" by default.
Assuming you want a workaround, run this code on DOM Load (or body load) to fix it in Firefox
document.getElementById("mySel").selectedIndex = 0;
http://jsfiddle.net/6WjgZ/2/
Not sure if this can be called a bug (more of a behavior style), if you think about it, FF doesn't let you choose disabled items. Neither does other browsers (except IE) but then, they choose to behave differently for the initial load.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With