Solved

SelectAll/UnselectAll checkboxeList items on a webform without postback

Posted on 2006-06-16
1
470 Views
Last Modified: 2012-05-05
I have an checkboxlist on the web form, I want to check/uncheck all the checkboxes with out a postback. ie if I click a particular button the form should not post back and all the checkboxes in the checkboxlist be selected and vice-versa...

Thanks!
0
Comment
Question by:srafi78
1 Comment
 
LVL 1

Accepted Solution

by:
parshu21 earned 250 total points
ID: 16922345
Maybe a script like this will help:

<script language="javascript">
function CheckAllCheckBoxes(Select)
{
      var Frm = document.Form1;
      var actVar  = Select.checked;
      for(i = 0;i<document.Form1.length;i++)
      {
            e = document.Form1.elements[i];
            if(e.type == 'checkbox' )
            {                     
                  var ChkBox=document.getElementById(e.id);
                  e.checked = Select.checked;  
            }                                             
      }
}
</script>

here all u need to do is pass variable "select" as main checkbox object on whose check and uncheck all the other checkboxes shud change.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This video discusses moving either the default database or any database to a new volume.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now