Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2005-06-27 07:43:20

gocher
New member
From: Germany
Registered: 2005-04-14
Posts: 4
Website

Forms problem: removeAttribute("readonly")

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

#2 2005-06-27 11:02:48

mokhet
Xinha Authority
From: Paris, France
Registered: 2005-04-03
Posts: 105
Website

Re: Forms problem: removeAttribute("readonly")

Hello gocher, in case you dont get my mail quick enough (i have qmail issues hmm ) , here is what i found. Hope it helps you

The trick seems to be in the uppercase O in the object.readOnly big_smile

<!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

Board footer

Powered by FluxBB