Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Nov 2002
    Posts
    672
    Thanks
    1
    Thanked 1 Time in 1 Post

    inactive buttons

    I've seen inactive buttons on pages. The kind that are dimmed. You see these type of things in install programs where it does not become active until you check "I agree". I want to know how that is done and if I can also make checkboxes inactive too.

  • #2
    New Coder
    Join Date
    Jan 2003
    Location
    NC, USA
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    here ya go

    <?xml version="1.0"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/transitional.dtd">
    <html xmlns="http://www.w3.org/TR/xhtml1">
    <head>
    <title>
    </title>
    </head>
    <body onLoad="document.forms[0].elements[0].disabled = true">
    <form>
    <input type="button" value="Off">
    </form>
    </body>
    </html>

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    document.getElementById('element').disabled = true;

  • #4
    Regular Coder
    Join Date
    Nov 2002
    Posts
    672
    Thanks
    1
    Thanked 1 Time in 1 Post

    Thumbs up

    As simple as that was, I figured it out on my own as far as the disbled="disabled" attribute goes (I used setAttribute in a for loop too). But I never knew about document.forms[0].elements[0].disabled was even such a method. I always used document.forms[0][0]. Thanks!


  •  

    Posting Permissions

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