We help IT Professionals succeed at work.

Checking all checkboxes in classic asp

Bob Schneider
How can I check all checkboxes using the "Select All" checkbox from below please?

                    <ul class="list-group">
                        <li class="list-group-item" style="font-weight: bold;"><input type="checkbox" name="select_all" id="select_all">&nbsp;Select All</li>
                        <%For i = 0 To UBOund(PackMmbrs, 2) - 1%>
                                <li class="list-group-item">
                                    <input type="checkbox" name="select_<%=PackMmbrs(0, i)%>" id="select_<%=PackMmbrs(0, i)%>">
                                    <%=PackMmbrs(3, i)%>, <%=PackMmbrs(2, i)%>(<%=GetTeamName(PackMmbrs(4, i))%>)

Open in new window

Thank you!
Watch Question

Dorababu MSenior Software Engineer
Distinguished Expert 2018
Use Jquery try this apply a class to header check box

$(function () {
        function() {
            $('#list-group-item').prop('checked', true);
        function() {
            $('#list-group-item').prop('checked', false);

Open in new window

Or you can try from the link

Developer & EE Moderator
Fellow 2018
Most Valuable Expert 2013
<!DOCTYPE html>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>Check box</title>
  <script src="https://code.jquery.com/jquery-3.1.0.js"></script>
    if($(this).prop('checked')){ // IF TRUE
            // CHECK THE BOXES
          // UNCHECK THE BOXES
<input type="checkbox" id="selectAll">select all  
<input type="checkbox" class="abc" name="select_1">1
<input type="checkbox" class="abc" name="select_2">2
<input type="checkbox" class="abc" name="select_3"> 3 

Open in new window