I'm in a situation where I have to use the disabled attribute to deactivate all inputs I don't want the user to edit.
<input disabled="<%= disableInputs%>" type="text"></input>
that renders
<input disabled="False" type="text"></input>
or
<input disabled="True" type="text"></input>
This works fine on Chrome and FF, but on IE it does not.
Now I'm trying to remove those attributes (where disabled="False") with javascript, but I don't get the expected results. Againt, it the javascript works gor Chrome and FF, but not for IE (using 8).
at the end it should look like:
<input type="text"></input>
or
<input disabled="True" type="text"></input>
my javascript looks like (i've tried almost any combination):
$('document').ready(function () {
$("input[disabled='false']").each(function(){$(this).attr('disabled', false);});
$("select[disabled='false']").each(function(){$(this).attr('disabled', false);});
$("input[disabled='False']").each(function(){$(this).attr('disabled', false);});
$("select[disabled='False']").each(function(){$(this).attr('disabled', false);});
$("input[readonly='false']").each(function(){$(this).attr('readonly', false);});
$("select[readonly='false']").each(function(){$(this).attr('readonly', false);});
$("input[readonly='False']").each(function(){$(this).attr('readonly', false);});
$("select[readonly='False']").each(function(){$(this).attr('readonly', false);});
$("input[disabled='false']").each(function(){$(this).removeAttr('disabled');});
$("select[disabled='false']").each(function(){$(this).removeAttr('disabled');});
$("input[disabled='False']").each(function(){$(this).removeAttr('disabled');});
$("select[disabled='False']").each(function(){$(this).removeAttr('disabled');});
$("input[readonly='false']").each(function(){$(this).removeAttr('readonly');});
$("select[readonly='false']").each(function(){$(this).removeAttr('readonly');});
$("input[readonly='False']").each(function(){$(this).removeAttr('readonly');});
$("select[readonly='False']").each(function(){$(this).removeAttr('readonly');});
});
A live example at: http://jsfiddle.net/2LNa6/ UPDATED