467,912 Members | 1,400 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,912 developers. It's quick & easy.

question about readonly property

HI, all
I found the return value from obj.readOnly is always the original vaule in
HTML setting, even after doing obj.readOnly=true/false. How can I get the
real time value set by javascript?

jack
Jul 23 '05 #1
  • viewed: 9714
Share:
4 Replies
Lee
datactrl said:

HI, all
I found the return value from obj.readOnly is always the original vaule in
HTML setting, even after doing obj.readOnly=true/false. How can I get the
real time value set by javascript?


The new value is submitted regardless of the readonly setting.
What makes you think that it isn't?
If you're submitting to the same page, you won't see the new
value in the form field.

Jul 23 '05 #2
For example ...

<TD>
<INPUT TYPE="text" id="itemdesc" READONLY class=scFieldRecList
name="page1"></TD>
<TD>
.....
itemdesc.readOnly=false;
alert(itemdesc.readOnly);
.....
I mean the alert always show "true" rather than "false".

Jack
Jul 23 '05 #3
Lee
datactrl said:

For example ...

<TD>
<INPUT TYPE="text" id="itemdesc" READONLY class=scFieldRecList
name="page1"></TD>
<TD>
....
itemdesc.readOnly=false;
alert(itemdesc.readOnly);
....
I mean the alert always show "true" rather than "false".


This alerts false in Netscape 7.1 and IE 6:

<html>
<body>
<form>
<INPUT TYPE="text"
id="itemdesc"
READONLY
class=scFieldRecList
value="initial value"
name="page1">
</form>
<script>
document.getElementById("itemdesc").readOnly=false ;
document.getElementById("itemdesc").value="new value";
alert(document.getElementById("itemdesc").readOnly );
</script>
</body>
</html>

Jul 23 '05 #4
Thank's Lee
Yes, it should be exactly as what you show on your sample. I ve got to
check my program. My example is just a short cut from my real one. Thank you
very much!

Jack
"Lee" <RE**************@cox.net> wrote in message
news:ca*********@drn.newsguy.com...
datactrl said:

For example ...

<TD>
<INPUT TYPE="text" id="itemdesc" READONLY class=scFieldRecList
name="page1"></TD>
<TD>
....
itemdesc.readOnly=false;
alert(itemdesc.readOnly);
....
I mean the alert always show "true" rather than "false".


This alerts false in Netscape 7.1 and IE 6:

<html>
<body>
<form>
<INPUT TYPE="text"
id="itemdesc"
READONLY
class=scFieldRecList
value="initial value"
name="page1">
</form>
<script>
document.getElementById("itemdesc").readOnly=false ;
document.getElementById("itemdesc").value="new value";
alert(document.getElementById("itemdesc").readOnly );
</script>
</body>
</html>

Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Joe Fallon | last post: by
3 posts views Thread by Ken H | last post: by
8 posts views Thread by Nikolay Petrov | last post: by
15 posts views Thread by Brian Haynes | last post: by
3 posts views Thread by =?Utf-8?B?VGVycnk=?= | last post: by
4 posts views Thread by RobG | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.