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. Advertisements

  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. Advertisements

  3. Hamish

    Hamish Guest

    Thanks
     
    Hamish, Nov 19, 2004
    #3
    1. Advertisements

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:
    755
    andrei
    Jul 30, 2003
  2. Learning SQL Server
    Replies:
    2
    Views:
    2,653
    Learning SQL Server
    Aug 7, 2003
  3. doug albright
    Replies:
    0
    Views:
    562
    doug albright
    Aug 30, 2003
  4. Dave Wurtz

    PropertyGrid - ReadOnly

    Dave Wurtz, Nov 13, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    2,989
    Dave Wurtz
    Nov 14, 2003
  5. Frank

    cookies readonly !!!!!

    Frank, Dec 24, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    3,485
    Fuccio DaVietre
    Dec 26, 2003
  6. Patrick Spieler

    ReadOnly Mode for WebForms

    Patrick Spieler, Feb 4, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    366
    Rimu Atkinson
    Feb 4, 2004
  7. =?Utf-8?B?TWljaGFlbCBTTA==?=

    Make HtmlTextArea Readonly on the fly

    =?Utf-8?B?TWljaGFlbCBTTA==?=, Feb 18, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    4,351
    =?Utf-8?B?TWljaGFlbCBTTA==?=
    Feb 18, 2004
  8. Jonathan Hyatt
    Replies:
    1
    Views:
    3,000
    Jonathan Hyatt
    Jun 8, 2004
Loading...