225
226 <asp:Label ID="lblAmericanLeague" runat="server" Text="American League"></asp:Label>
227 <asp:DropDownList ID="AmericanLeague" runat="server">
228 <asp:ListItem Text="-Select-" Value="-1" ></asp:ListItem>
229 <asp:ListItem Text="Chicago White Sox" Value="ChicagoWhiteSox" ></asp:ListItem>
230 <asp:ListItem Text="Baltimore Orioles" Value="BaltimoreOrioles" ></asp:ListItem>
231 <asp:ListItem Text="Boston Red Sox" Value="BostonRedSox" ></asp:ListItem>
232 <asp:ListItem Text="New York Yankees" Value="NewYorkYankees" ></asp:ListItem>
243 </asp:DropDownList><br />
244
245 <asp:Label ID="lblNationalLeague" runat="server" Text="National League"></asp:Label>
246 <asp:DropDownList ID="NationalLeague" runat="server">
247 <asp:ListItem Text="-Select-" Value="-1" ></asp:ListItem>
248 <asp:ListItem Text="ChicagoCubs" Value="ChicagoCubs" ></asp:ListItem>
249 <asp:ListItem Text="AtlantaBraves" Value="AtlantaBraves" ></asp:ListItem>
250 <asp:ListItem Text="FloridaMarlins" Value="FloridaMarlins" ></asp:ListItem>
264 </asp:DropDownList><br />
and the jquery looks like this ...
302
303 <script type="text/javascript" >
304 $(document).ready(function() {
305 $('#<%=NationalLeague.ClientID %>').click(function() {
306 var SelectedVal = $('#<%=NationalLeague.ClientID %>').val();
307 if (SelectedVal == "-1") {
308 $('#<%=AmericanLeague.ClientID %>').removeAttr("disabled");
309 }
310 else {
311 $('#<%=AmericanLeague.ClientID %>').val("-1");
312 $('#<%=AmericanLeague.ClientID %>').attr("disabled", true);
313 }
314 });
315 $('#<%=AmericanLeague.ClientID %>').click(function() {
316 var SelectedVal = $('#<%=AmericanLeague.ClientID %>').val();
317 if (SelectedVal == "-1") {
318 $('#<%=NationalLeague.ClientID %>').removeAttr("disabled");
319 }
320 else {
321 $('#<%=NationalLeague.ClientID %>').val("-1");
322 $('#<%=NationalLeague.ClientID %>').attr("disabled", true);
323 }
324 });
325 });
326
327 </script>
No comments:
Post a Comment