disabling form input elements

Discussion in 'Javascript' started by Bill, Nov 2, 2003.

  1. Bill

    Bill Guest

    Hi.

    Is there any way to make form input elements inactive, ie to disable them?

    I've seen such a thing in VB but can't find anything in HTML/Javascript
    references.

    Thanks.
     
    Bill, Nov 2, 2003
    #1
    1. Advertising

  2. "Bill" <> writes:

    > Is there any way to make form input elements inactive, ie to disable them?


    There are different ways, depending on what you mean by disable:

    formElem.disabled = true;

    Setting it "disabled" means that you can't use it (edit text, click
    button), and it isn't sent when the form is submitted.

    formElem.readOnly = true;

    A text (input/textarea) can be set readOnly. Then it just can't be
    changed, but is still submitted.

    > I've seen such a thing in VB but can't find anything in HTML/Javascript
    > references.


    What did you write in VB?

    /L
    --
    Lasse Reichstein Nielsen -
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
    'Faith without judgement merely degrades the spirit divine.'
     
    Lasse Reichstein Nielsen, Nov 2, 2003
    #2
    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. Jason Galvin

    Disabling auto-populating of form elements

    Jason Galvin, Dec 10, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    368
    Teemu Keiski
    Dec 10, 2003
  2. Kevin Blount

    disabling form elements

    Kevin Blount, Dec 4, 2003, in forum: Javascript
    Replies:
    0
    Views:
    86
    Kevin Blount
    Dec 4, 2003
  3. Perttu Pulkkinen

    The most trustable way of blurring/disabling elements

    Perttu Pulkkinen, Aug 4, 2004, in forum: Javascript
    Replies:
    2
    Views:
    109
    Perttu Pulkkinen
    Aug 4, 2004
  4. omidmottaghi

    disabling form elements in IE

    omidmottaghi, Oct 28, 2005, in forum: Javascript
    Replies:
    4
    Views:
    98
    omidmottaghi
    Oct 30, 2005
  5. shankwheat

    Disabling Form Elements

    shankwheat, Oct 17, 2006, in forum: Javascript
    Replies:
    11
    Views:
    204
Loading...

Share This Page