I am in a situation where I need to use a disabled attribute to deactivate all inputs that I do not want to edit.
<input disabled="<%= disableInputs%>" type="text"></input>
which displays
<input disabled="False" type="text"></input>
or
<input disabled="True" type="text"></input>
This works fine on Chrome and FF, but in IE it is not.
Now I am trying to remove these attributes (where disabled = "False") using javascript, but I am not getting the expected results. Againt, it runs javascript gor Chrome and FF, but not for IE (using 8).
at the end it should look like this:
<input type="text"></input>
or
<input disabled="True" type="text"></input>
my javascript looks like (I 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');}); });
Live example: http://jsfiddle.net/2LNa6/ UPDATED
jquery internet-explorer attributes
Marco Bruggmann 03 Oct '11 at 16:25 2011-10-03 16:25
source share