According to HTML specs, the select
tag in HTML doesn\'t have a readonly
attribute, only a disabled
attribute. So if you want to keep
If you disable a form field, this won't be sent when form is submitted.
So if you need a readonly
that works like disabled
but sending values do this :
After any change in readonly properties of an element.
$('select.readonly option:not(:selected)').attr('disabled',true);
$('select:not([readonly]) option').removeAttr('disabled');