so in my view I have this
for (int i = 0; i < Model.Count; i++)
{
@Html.EditorFor(m => m[i].IsSingle)
}
And depends on the number of Model.Count it will generate the Checkbox, sometimes it is more than 10 and sometimes it is 7 based on the List given from the Controller.
What I needed to do next is to check that if the user ticked one of the IsSingle, then another div will be displays.
$(document).ready(function () {
if (document.getElementById("Single").checked == true) {
$("#tdSingle").show();
}
else {
$("#tdSingle").hide();
}
});
});
I need to tweak the above code so that It will display the #tdSingle, if any of the checkbox is ticked. Anyone know how to achieve that?
This is the sample of the EditorFor code being generated
<input class="check-box" id="z0__IsSingle" name="[0].IsSingle" type="checkbox" value="true">
Sorry if I am being unclear.
Thanks a lot!