Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-19-2012, 01:13 AM   PM User | #1
olojtd4
New to the CF scene

 
Join Date: Feb 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
olojtd4 is an unknown quantity at this point
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.
olojtd4 is offline   Reply With Quote
Old 02-19-2012, 04:17 AM   PM User | #2
jmrker
Senior Coder

 
jmrker's Avatar
 
Join Date: Aug 2006
Location: FL
Posts: 2,764
Thanks: 29
Thanked 453 Times in 447 Posts
jmrker will become famous soon enough
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>
jmrker is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:57 PM.


Advertisement
Log in to turn off these ads.