SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    disable a radio button help needed

    i don't know what's wrong here pls help

    my form name is myForm
    the Appstatus1 is a radio button

    when i try to put it on a function for ONLOAD it doesn't disable the radio button

    document.myForm.Appstatus1.disabled=true;

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,702
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    I don't know what you're doing wrong but the general application works.

    Code javascript:
    <html>
    <head>
    <script>
    window.onload = function () {
    document.myForm.Appstatus1.disabled=true;
    }
    </script>
    </head>
    <body>
    <form id="myForm" name="myForm">
    <input type="radio" name="Appstatus1">
    </form>
    </body>
    </html>

    You may have to show us what you're doing for further troubleshooting.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

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