Firefox ignores option selected="selected"

Add autocomplete="off" HTML attribute to every select tag.

(source: https://stackoverflow.com/a/8258154/260080)


In firefox, I've notice that the "selected" attribute will not work unless you place the select inside a form, where the form has a name attribute.


Just had the same issue, believe me it's been more than 10 hours struggling with this stupid firefox behavior, i have 7 dropdowns, each of them will trigger an event and fill in 24 hidden inputs, so you can imagine having the right option selected with 24 wrong input values!!! the solution i finally found is to reset the form with Javascript adding this line of code:

window.onload = function() { document.forms['MarkerForm'].reset(); };

PS: the inputs have the values pulled from a database, so resetting the form does not empty any value but in a way tells firefox to go back the hell to selected=selected option!