Checking all checkboxes in classic asp

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))%>)
                                </li>
                        <%Next%>
                    </ul>

Open in new window


Thank you!
Bob SchneiderCo-OwnerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dorababu MSenior Software EngineerCommented:
Use Jquery try this apply a class to header check box

$(function () {
    $('#selectall').toggle(
        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

http://www.jqueryfaqs.com/Articles/Multiple-Select-MultiSelect-DropDownList-with-CheckBoxes-using-jQuery.aspx
1
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
<!DOCTYPE html>
<html>
<head>
  <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>
<script>
$(function(){
  $('#selectAll').on('click',function(){
    if($(this).prop('checked')){ // IF TRUE
            // CHECK THE BOXES
      $('.abc').prop('checked',true);
    }else{
          // UNCHECK THE BOXES
      $('.abc').prop('checked',false);
    }
     
  });
});  
</script>
</head>
<body>
<input type="checkbox" id="selectAll">select all  
  <hr>
<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 
</body>
</html>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.