Hi,
I need to loop through the AJAX Combobox client side and retreive the text and value of the items. I have defined the combobox as
<ajaxToolkit:ComboBox ID="ajxCbxSuppName" ClientIDMode="Static" DataSourceID="SqlDataSource1" RenderMode="Block" CssClass="txtBoxClass1 WindowsStyle" AutoPostBack="False" AutoCompleteMode="Suggest" runat="server" DataTextField="SUPPLIER_NAME" DataValueField="ID" MaxLength="0" AppendDataBoundItems="true" DropDownStyle="DropDown"></ajaxToolkit:ComboBox><asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString='<%$ ConnectionStrings:conString %>' SelectCommand="SELECT [SUPPLIER_NAME], [ID] FROM [SUPPLIER_MAST] ORDER BY [SUPPLIER_NAME]"></asp:SqlDataSource>
I have used the following function to loop through the items
$(function () {
alert("awit");$("<%=ajxCbxSuppName.ClientID%> option").each(function (i) {
alert("awit888");
alert($(this).text() + " : " + $(this).val());
});
});But it doesn't enter the function at all. The combobox ID is not recognized . How else can i refer the ID to make it work.
Please help
Regards
Sanjish