question about readonly property

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • datactrl

    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=tr ue/false. How can I get the
    real time value set by javascript?

    jack


  • Lee

    #2
    Re: question about readonly property

    datactrl said:[color=blue]
    >
    >HI, all
    >I found the return value from obj.readOnly is always the original vaule in
    >HTML setting, even after doing obj.readOnly=tr ue/false. How can I get the
    >real time value set by javascript?[/color]

    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.

    Comment

    • datactrl

      #3
      Re: question about readonly property

      For example ...

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

      Jack


      Comment

      • Lee

        #4
        Re: question about readonly property

        datactrl said:[color=blue]
        >
        >For example ...
        >
        ><TD>
        ><INPUT TYPE="text" id="itemdesc" READONLY class=scFieldRe cList
        >name="page1" ></TD>
        ><TD>
        >....
        >itemdesc.readO nly=false;
        >alert(itemdesc .readOnly);
        >....
        >I mean the alert always show "true" rather than "false".[/color]

        This alerts false in Netscape 7.1 and IE 6:

        <html>
        <body>
        <form>
        <INPUT TYPE="text"
        id="itemdesc"
        READONLY
        class=scFieldRe cList
        value="initial value"
        name="page1">
        </form>
        <script>
        document.getEle mentById("itemd esc").readOnly= false;
        document.getEle mentById("itemd esc").value="ne w value";
        alert(document. getElementById( "itemdesc").rea dOnly);
        </script>
        </body>
        </html>

        Comment

        • datactrl

          #5
          Re: question about readonly property

          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" <REM0VElbspamtr ap@cox.net> wrote in message
          news:ca5mln012l 0@drn.newsguy.c om...[color=blue]
          > datactrl said:[color=green]
          > >
          > >For example ...
          > >
          > ><TD>
          > ><INPUT TYPE="text" id="itemdesc" READONLY class=scFieldRe cList
          > >name="page1" ></TD>
          > ><TD>
          > >....
          > >itemdesc.readO nly=false;
          > >alert(itemdesc .readOnly);
          > >....
          > >I mean the alert always show "true" rather than "false".[/color]
          >
          > This alerts false in Netscape 7.1 and IE 6:
          >
          > <html>
          > <body>
          > <form>
          > <INPUT TYPE="text"
          > id="itemdesc"
          > READONLY
          > class=scFieldRe cList
          > value="initial value"
          > name="page1">
          > </form>
          > <script>
          > document.getEle mentById("itemd esc").readOnly= false;
          > document.getEle mentById("itemd esc").value="ne w value";
          > alert(document. getElementById( "itemdesc").rea dOnly);
          > </script>
          > </body>
          > </html>
          >[/color]


          Comment

          Working...