question about readonly property

Discussion in 'Javascript' started by datactrl, Jun 8, 2004.

  1. datactrl

    datactrl Guest

    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
     
    datactrl, Jun 8, 2004
    #1
    1. Advertising

  2. datactrl

    Lee Guest

    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.
     
    Lee, Jun 8, 2004
    #2
    1. Advertising

  3. datactrl

    datactrl Guest

    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
     
    datactrl, Jun 9, 2004
    #3
  4. datactrl

    Lee Guest

    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>
     
    Lee, Jun 9, 2004
    #4
  5. datactrl

    datactrl Guest

    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>
    >
     
    datactrl, Jun 9, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jon Maz
    Replies:
    4
    Views:
    18,962
    Jon Maz
    Feb 20, 2004
  2. =?iso-8859-1?q?Joey_Ch=F6mpff?=

    ObjectDataSource and ReadOnly Object Property

    =?iso-8859-1?q?Joey_Ch=F6mpff?=, Jan 13, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    511
    =?iso-8859-1?q?Joey_Ch=F6mpff?=
    Jan 13, 2006
  3. =?Utf-8?B?Sm9leSBDaMO2bXBmZg==?=

    ObjectDataSource and ReadOnly Object Property

    =?Utf-8?B?Sm9leSBDaMO2bXBmZg==?=, Jan 14, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    570
    =?Utf-8?B?Sm9leSBDaMO2bXBmZg==?=
    Jan 14, 2006
  4. John Smith
    Replies:
    5
    Views:
    7,049
    Bob Barrows [MVP]
    Jun 6, 2006
  5. Jonathan Hyatt
    Replies:
    1
    Views:
    1,943
    Jonathan Hyatt
    Jun 8, 2004
Loading...

Share This Page