Howdy,
I searched the group for a few hours yesterday and didn't see anything
that helped me. Maybe I overlooked it...anyway here's my issue:
I have dropdowns of conference sessions which are ran twice each over
the course of the conference. We don't want people signing up for the
same session so I need to disable the option/session in other
dropdowns. The below works in FF and Chrome but not IE. I've been
able to disable an entire select in IE but not specific options.
Other questions: is there a way to select an option by it's value? I
don't know how so I added each option to a class of it's value. Also,
is a case statement for each select tag the only way to do this or
could I have one function that would cover all the selects? There are
18 sessions ran twice over 8 time periods/select dropdowns.
Thanks!
<html>
<head>
<title>Ajax with jQuery Example</title>
<script type="text/JavaScript" src="../jquery/jquery.js"></script>
<script>
$(document).ready(function(){
$("#session1").change(function (){
var selected = $("#session1 [EMAIL PROTECTED]").val();
/* ### I've also tried var selected = $
("#session1 option:selected").val(); ## */
switch(selected)
{
case '':
$("#session2 >
option").removeAttr("disabled");
break;
case '2':
$("#session2
option.2").attr("disabled", "disabled"),
$("#session2 > option.
11").removeAttr("disabled");
break;
case '11':
$("#session2
option.11").attr("disabled", "disabled"),
$("#session2 > option.
2").removeAttr("disabled");
break;
}
});
});
</script>
</head>
<body>
<div id="selectDIV">
<select name="session1" id="session1"class="titles">
<option value="">Select a Session</option>
<option value="2" class="2">Session 2</option>
<option value="11" class="11">Session 11</option>
<option value="16" class="16">Session 16</option>
</select>
<br>
<br>
<select name="session2" id="session2"class="titles">
<option value="">Select a Session</option>
<option value="2" class="2">Session 2</option>
<option value="6" class="6">Session 6</option>
<option value="11" class="11">Session 11</option>
</select>
</div>
</body>
</html>