dcsimg
www.webdeveloper.com
Results 1 to 6 of 6

Thread: deactivate submit button

  1. #1
    Join Date
    Jun 2004
    Location
    48°46′36″ N 9°10′48″ E
    Posts
    3,747

    deactivate submit button

    hi, im wondering, how can u deactivate a sumbit button?or any form button?

  2. #2
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    <form action="some-script.pl" onsubmit="return check (this); return false">

    If the function check() returns false the form does not submit.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  3. #3
    Join Date
    Jun 2004
    Location
    48°46′36″ N 9°10′48″ E
    Posts
    3,747
    does the button then appear grey in IE?

  4. #4
    Join Date
    Nov 2002
    Location
    Auburn, AL
    Posts
    9,222
    You can also use disabled="true" for a button.

  5. #5
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    Originally posted by PeOfEo
    You can also use disabled="true" for a button.
    That's how you set something to diabled with JavaScript. With HTML it is different and with XHTML it is different again. But often it is a bad to have your button disabled by default. People without JavaScript will not be able to use it.

    If you do want the button to default to disabled then you could use HTML:

    <button disabled>Foo</button>

    or in XHTML:

    <button disabled="disabled">Foo</button>

    See http://www.w3.org/TR/html401/interac...ml#edef-BUTTON .
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  6. #6
    Join Date
    Jun 2004
    Location
    48°46′36″ N 9°10′48″ E
    Posts
    3,747
    thank u just what i needed..its just to block a form until i finished writing the processing file...

    thx

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles