Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SelectAll/UnselectAll checkboxeList items on a webform without postback

Posted on 2006-06-16
1
Medium Priority
?
479 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 1000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Integration Management Part 2
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

885 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