Hello everyone,
I have an .ascx(controller) and a javascript files.
THE SCENARIO:
When i click the checkbox it must show and hide other checkbox, and not only the checkbox but the label too. The fact is now i succeed to make it hide just the checkbox. And i need to make hide the label too.
here is the raw code from ascx file:
<ItemTemplate>
<li class="area">
<input type="checkbox" class="category" value="<%# 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="<%#string.Concat(CurrentLocation.Area1,"| ", CurrentLocation.Area2,"| ", CurrentLocation.Area3)%>" />
<label>
<%#CurrentLocation.Area3%>
</label>
</li>
</ItemTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
</asp:Repeater>
</li>
</ItemTemplate>
And here is the javascript file:
function updateByArea(current) {
if (current.attr("checked") == null || current.attr("checked") == "")
$j(".area ul li input [value^='" + current.val() + "']:checked").removeAttr("checked").hide();
$j("#searchFilter .area>input:checkbox:checked").each(function (i, item) {
$j(".area ul li input[value^='" + $j(item).val() + "']:not(:checked)").attr("checked", "checked").show();
});
}
THE QUESTION:
how i add the label to javascript code so when the user clicks the checkbiox and hides the checkbox to hide the label too?
Thank you in advance