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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Greyed dropdown based on radio button selection

    form is .asp
    scenario:

    I have 3 radio buttons above number of boxes (dropdown). I want the dropdown selection box greyed out on selecting Electronic (radio button)


    Physical (radio button)
    Image (radio button)
    Electronic (radio button)

    Number of Boxes [dropdown box]

    Thanks for your help
    I am new to coding.

  • #2
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,083
    Thanks
    38
    Thanked 498 Times in 492 Posts

    Lightbulb Try this ...

    Doesn't really need any javascript ...
    Code:
    <html>
    <head>
    <title> Untitled </title>
    </head>
    <body>
    <label><input type="radio" name="RBtn" onclick="document.getElementById('SBox').disabled=false" checked>
     Physical </label>
    <label><input type="radio" name="RBtn" onclick="document.getElementById('SBox').disabled=false">
     Image </label>
    <label><input type="radio" name="RBtn" onclick="document.getElementById('SBox').disabled=true">
     Electronic </label>
    <br>
    <select id="SBox">
     <option value="">Select</option>
     <option value="1"> 1 </option>
     <option value="2"> 2 </option>
     <option value="3"> 3 </option>
     <option value="4"> 4 </option>
    </select>
    </body>
    </html>


  •  

    Posting Permissions

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