how to make condition on selection of checkbox in user controler
Posted
by kumar
on Stack Overflow
See other posts from Stack Overflow
or by kumar
Published on 2010-05-18T15:13:31Z
Indexed on
2010/05/18
18:00 UTC
Read the original article
Hit count: 190
jQuery
I have a user control
<input id="check" type="checkbox" />
<label> </label>
<fieldset class="clearfix" id="fieldset-exception">
<legend>Student Information</legend>
<div class="fiveper">
<label for="StudentID">
Exception ID:
<span><%=Html.EditorFor(x => x.studentid)%></span>
</label>
<label for="Classroom">
Origination:
<span><%=Html.EditorFor(model => model.Classroom)%></span>
</label>
<label for="Subject">
Age:
<span><%=Html.EditorFor(model => model.subject)%></span>
</label>
</div>
$('#btnAll').click(function() {
$('#Details input[type=checkbox]').attr('checked', 'checked');
});
I am checking all checkboxes using above code but I need to make condition here that user need to select atleast one checkbox to do something? i have other button to go other page based on this checkbox checked? can anybody tell me how to check that and how to make that condition here? Thanks thanks
© Stack Overflow or respective owner