D J
asked on
ColdFusion How to disable "All" in Drop down when radio button is selected
How can I disable "All" in my drop down when the user selects a radio button in a query?
I.E. Make the user select an option in the drop down, when a radio button is selected.
Radio code:
Drop down code:
I.E. Make the user select an option in the drop down, when a radio button is selected.
Radio code:
<input type="radio" name="showall" id="showall" value="1" />
Drop down code:
<select name="discipline1" style=width:170px;>
<option value="ALL">ALL</option>
<cfoutput query="DropDown1">
<option value="#DropDown1.ship#">#DropDown1.ship#</option>
</cfoutput>
</select>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
1.
Make the user select an option in the drop down, when a radio button is selected.2.
How to disable "All" in Drop down when radio button is selectedHm.. those are 2 different things. Which one do you need? If it's 1, try my example. If it's 2, try myselfrandhawa's.
ASKER
Thanks _agx_ for sharing your knowledge.
$("#showall").click(functi
var i = $(this).val();
alert(i);
if (i == '1') {
var selectAll = $("#discipline1 option:first").val();
if ($.trim(selectAll) == 'ALL') {
$("#discipline1 option:first").attr('disab
}
}
});¿
<input type="radio" name="showall" id="showall" value="1" />
<select name="discipline1" id="discipline1" style=width:170px;>
<option value="ALL">ALL</option>
<option value="2">2</option>
<option value="3">3</option>
</select>¿
Check this:
http://jsfiddle.net/NpNFh/6/