THE SCENARIO:I have a search based on checkboxes which until now was static, meaning all the checkboxes were shown when the page was loading. I made some changes like when the page loads, the children checkboxes are not visible. it shows only the parent (District). the picture for a better understanding:Initial view when page loadsI succeed to create with my few knowledge of javascript to hide and show the children checkboxes (Area 1, Category 1 etc). picture:This is what I succeedTHE QUESTION:What i need is when you check the District checkbox is to display just Area 1 Area 2, Area 3 etc., unchecked. Can someone show me? i am not so good at javascript. Picture:Here is the link with the view for what i must accomplishhttp://www.freeimagehosting.net/muddzAnd here is the javascript code:function updateByDistrict(current) {//If current is unchecked => uncheck all child checkboxesif (current.attr("checked") == null || current.attr("checked") == "") var checkBox0 = $j(".district ul li input[value^='" + current.val() + "']:checked").removeAttr("checked"); $j(checkBox0).parent().hide(); current.blur(); $j("#searchFilter .district>input:checkbox:checked").each(function (i, item) { var checkBoxa = $j(".district ul li input[value^='" + $j(item).val() + "']:not
checked)"); $j(checkBoxa).parent().show(); $j(checkBoxa).attr("checked", "checked"); });//Uncheck all-checkbox if there are any unchecked, otherwise check all-checkbox$j("#searchFilter #areas .all").attr("checked", $j("#searchFilter #areas input:checkbox[class!='all']:checked").length > 0 ? '' : 'checked');$j(".premise").showItem();}function updateByArea(current) {//If current is unchecked => uncheck all child checkboxesif (current.attr("checked") == null || current.attr("checked") == "") var checkBox1 = $j(".area ul li input[value^='" + current.val() + "']:checked").removeAttr("checked"); //checkbox$j(checkBox1).parent().hide(); $j("#searchFilter .area>input:checkbox:checked").each(function (i, item) { var checkBox = $j(".area ul li input[value^='" + $j(item).val() + "']:not
checked)"); $j(checkBox).parent().show(); $j(checkBox).attr("checked", "checked"); });var districtNode = current.parents(".district");//Check district(L?n) if all child checkboxes are checkeddistrictNode.children("input:checkbox").attr("checked", districtNode.find("input:checkbox:not
checked)").length == 0 ? "checked" : "");//Uncheck all-checkbox if there are any unchecked, otherwise check all-checkbox$j("#searchFilter #areas .all").attr("checked", $j("#searchFilter #areas input:checkbox[class!='all']:checked").length > 0 ? '' : 'checked');$j(".premise").showItem();}And here is the ASP.NET code:<ItemTemplate><li class="district"><input type="checkbox" value="http://stackoverflow.com/questions/12623654/<%#CurrentLocationName%>" /><label><%#CurrentLocationName%></label><asp:Repeater ID="Repeater1" runat="server" DataSource="<%# GetSecondAreas(CurrentLocationName) %>"><HeaderTemplate><ul></HeaderTemplate><ItemTemplate><li class="area"><input type="checkbox" class="category" value="http://stackoverflow.com/questions/12623654/<%# string.Concat(CurrentLocation.Area1,"| ", CurrentLocation.Area2)%>" /><label><%#CurrentLocation.Area2%></label><asp:Repeater ID="Repeater2" runat="server" DataSource="<%# GetThirdAreas(CurrentLocation.Area2) %>"><HeaderTemplate><ul></HeaderTemplate><ItemTemplate><li><input type="checkbox" class="category" value="http://stackoverflow.com/questions/12623654/<%#string.Concat(CurrentLocation.Area1,"| ", CurrentLocation.Area2,"| ", CurrentLocation.Area3)%>" /><label><%#CurrentLocation.Area3%></label></li></ItemTemplate><FooterTemplate></ul></FooterTemplate></asp:Repeater></li></ItemTemplate><FooterTemplate></ul></FooterTemplate></asp:Repeater></li></ItemTemplate>Thank you in advance


