Readonly

Discussion in 'Javascript' started by Hamish, Nov 19, 2004.

  1. Hamish

    Hamish Guest

    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.readonly = false, but this doesn't work

    Thanks
     
    Hamish, Nov 19, 2004
    #1
    1. Advertising

  2. Hamish wrote:

    > 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.readonly = false, but this doesn't work


    Case is important, the name of that property is readOnly and not readonly:
    http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-88461592
    so try
    <input type="radio"
    onclick="if (this.checked) {
    this.form.elements.inputName.readOnly = false;
    }">

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Nov 19, 2004
    #2
    1. Advertising

  3. Hamish

    Hamish Guest

    Thanks
     
    Hamish, Nov 19, 2004
    #3
    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. andrei

    Readonly checkbox in Datagrid

    andrei, Jul 30, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    618
    andrei
    Jul 30, 2003
  2. Learning SQL Server
    Replies:
    2
    Views:
    2,497
    Learning SQL Server
    Aug 7, 2003
  3. doug albright
    Replies:
    0
    Views:
    483
    doug albright
    Aug 30, 2003
  4. Dave Wurtz

    PropertyGrid - ReadOnly

    Dave Wurtz, Nov 13, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    2,847
    Dave Wurtz
    Nov 14, 2003
  5. Jonathan Hyatt
    Replies:
    1
    Views:
    2,032
    Jonathan Hyatt
    Jun 8, 2004
Loading...

Share This Page