I have a search panel with several checkboxlists, I would like to implement it in jquery rather than using server side code to make a call to database every time the user selects the items in checkboxlistes.
My detail problem as following description:
In my ASP.NET page named Default. aspx:
<asp:CheckBoxList ID="cblCarMake" runat="server" DataSourceID="SqlDataSource1" DataTextField="carMake"
DataValueField="Description" EnableViewState="False">
</asp:CheckBoxList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TrainingConnectionString %>"
SelectCommand="SELECT carMake FROM tblCar"></asp:SqlDataSource>
<br />
<asp:CheckBoxList ID="cblCarModel" runat="server" DataSourceID="SqlDataSource2" DataTextField="carModel"
DataValueField="Description" EnableViewState="False">
</asp:CheckBoxList>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:TrainingConnectionString %>"
SelectCommand="SELECT carModel FROM tblCar"></asp:SqlDataSource>
For example, in the car make checkboxlist, there are two checkboxlist items named BMW, Mercedes and in the car model checkboxlist, there are five checkboxlist items named 328I, 745LI, M3, S500, GL320. I like to use client code such jQuery or Javascript to do the action when I click on BMW then automatically checkmarks for 328I, 745LI, M3 and uncheck the BMW will deselect all items which associated with it. Similarly to the Mercerdes checkboxlist item. I could not figure out how to implement it. I really appreciate your expertise jQuery code to help me out on newbie jQuery client side. Thanks in advance.