Readonly

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

    #1

    Readonly

    I have an input box which is created with the readonly option included. Is
    it possible to turn this off.

    This is so the input box is not selectable untill a radio button is switched
    on.

    I have tried form.ip.readonl y = false, but this doesn't work

    Thanks




  • Martin Honnen

    #2
    Re: Readonly



    Hamish wrote:
    [color=blue]
    > I have an input box which is created with the readonly option included. Is
    > it possible to turn this off.
    >
    > This is so the input box is not selectable untill a radio button is switched
    > on.
    >
    > I have tried form.ip.readonl y = false, but this doesn't work[/color]

    Case is important, the name of that property is readOnly and not readonly:

    so try
    <input type="radio"
    onclick="if (this.checked) {
    this.form.eleme nts.inputName.r eadOnly = false;
    }">

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/

    Comment

    • Andrew Thompson

      #3
      Re: Readonly

      On Fri, 19 Nov 2004 12:20:35 +0000 (UTC), Hamish wrote:
      [color=blue]
      > I have an input box which is created with the readonly option included. Is
      > it possible to turn this off.[/color]

      ....
      <form action='get'>
      <input type='text' disabled id='tf' value='Hello!'>
      <input type='button'
      onclick='docume nt.getElementBy Id("tf").disabl ed=false;'
      value='Enable'>
      ....

      HTH

      --
      Andrew Thompson
      http://www.PhySci.org/codes/ Web & IT Help
      http://www.PhySci.org/ Open-source software suite
      http://www.1point1C.org/ Science & Technology
      http://www.LensEscapes.com/ Images that escape the mundane

      Comment

      • Hamish

        #4
        Re: Readonly

        Thanks



        Comment

        Working...