You are not logged in.
Hello,
does anybody know how to dynamically change a readonly attribute in IE?
I've tried object.readonly=false, object.removeAttribute("readonly"),
object.setAttribute("readonly",false),
but in IE 6.0 they don't do anything or produce any errors either.
Udo Schmal (Gocher)
Offline
Hello gocher, in case you dont get my mail quick enough (i have qmail issues ) , here is what i found. Hope it helps you
The trick seems to be in the uppercase O in the object.readOnly
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title></title>
<script>
function on() {
var el = document.getElementById('abc');
// el.removeAttribute("readonly");
el.readOnly = true;
}
function off() {
var el = document.getElementById('abc');
// el.setAttribute("readonly",true);
el.readOnly = false;
}
</script>
</head>
<body>
<form>
<input type="text" id="abc" value="AZERTYUIOP" readonly="readonly">
<input type="button" onclick="on();" value="readOnly = true">
<input type="button" onclick="off();" value="readOnly = false">
</form>
</body>
</html>
Offline