Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

SelectAll/UnselectAll checkboxeList items on a webform without postback

Posted on 2006-06-16
1
473 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

829 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