Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > question about readonly property

Reply
Thread Tools

question about readonly property

 
 
datactrl
Guest
Posts: n/a
 
      06-08-2004
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


 
Reply With Quote
 
 
 
 
Lee
Guest
Posts: n/a
 
      06-08-2004
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.

 
Reply With Quote
 
 
 
 
datactrl
Guest
Posts: n/a
 
      06-09-2004
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


 
Reply With Quote
 
Lee
Guest
Posts: n/a
 
      06-09-2004
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>

 
Reply With Quote
 
datactrl
Guest
Posts: n/a
 
      06-09-2004
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" <> wrote in message
news:...
> 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>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid: set ReadOnly property at runtime? John Smith ASP .Net 5 06-06-2006 03:30 PM
ObjectDataSource and ReadOnly Object Property =?Utf-8?B?Sm9leSBDaMO2bXBmZg==?= ASP .Net 0 01-14-2006 08:07 PM
ObjectDataSource and ReadOnly Object Property =?iso-8859-1?q?Joey_Ch=F6mpff?= ASP .Net 0 01-13-2006 11:07 PM
ASP.NET Readonly panel function with readonly checkbox, readonly radiobutton Jonathan Hyatt ASP .Net Web Controls 1 06-08-2004 07:42 PM
Declaring readonly public property in C# Jon Maz ASP .Net 4 02-20-2004 11:44 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57