I have a datalist (dlLockNumber) with a RadComboBox Control (rcbLockSeriesLockNumbers) in it. Depending on the number of records in the datalist, there could be one to 100 (or more) RadComboBox instances of rcbLockSeriesLockNumbers. I have a RadButton named "rbSelect" for each RadComboBox that is disabled upon page load - so that when someone selects some value other than the default ("-1"), the desired event is to enable the button. I have a javascript function named OnClientSelectedIndexChanged that hopefully would work but it does not. If any of you Javascript sharpies could take a look at the function and steer me in the right direction, it would be appreciated.
Here is the HTML side of the code - this is part of a .NET User Control:
Here is the HTML side of the code - this is part of a .NET User Control:
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="Keys.ascx.vb" Inherits="Controls_Keys" %><telerik:RadCodeBlock ID="rcblock1" runat="server"><script language="javascript" type="text/javascript"> function OnClientSelectedIndexChanged(sender, eventArgs) { var item = eventArgs.get_item(); var ddl = $find("<%= dlKeySeries.ClientID %>"); var button = ddl.get_items().getItem(0).findControl("rbSelect"); var strValue = item.options[item.selectedIndex].value; if (strValue == "-1") { button.set_enabled(false); } else { button.set_enabled(true); } }</script></telerik:RadCodeBlock><telerik:RadAjaxPanel ID="rapKeys" runat="server"><asp:Panel ID="pnlKeysTrue" Visible="true" runat="server"><table width="100%" align="center" border="0" cellpadding="0" cellspacing="0"> <tr> <td class="BlackSmall"> <br /> <asp:Literal ID="litSectionTitle" runat="server" /><br /> <asp:Literal ID="litSectionIntro" runat="server" /> </td> </tr> <tr id="trrcKeySeries" runat="server">
<td class="BlackSmall"> <br /> <asp:DataList ID="dlLockNumber" DataKeyField="SeriesLockID" OnItemDataBound="dlLockNumber_ItemDataBound" Width="100%" RepeatDirection="Vertical" RepeatColumns="3" runat="server"> <ItemTemplate> <asp:Label ID="lblSeriesLockID" Visible="false" runat="server"><%#Databinder.Eval(Container.DataItem, "SeriesLockID") %></asp:Label> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="top" style="width:196px;text-align:center"> <telerik:RadComboBox ID="rcbLockSeriesLockNumbers" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged" CausesValidation="false" AppendDataBoundItems="true" DataValueField="LockNumberID" Width="130px" ZIndex="20000" DataTextField="LockNumber" AutoPostBack="true" runat="server" /> </td> <td> <telerik:RadButton ID="rbSelect" Enabled="false" Skin="Sunset" OnClick="rbSelect_OnClick" runat="server" Text="Select" /> </td> </tr> </table> </ItemTemplate> </asp:DataList> </td> </tr></table></asp:Panel>