Completely Free .NET word API

Resources » TypeScript » Scripting Languages » Javascript

CheckBox SelectAll / DeSelectAll using Javascript...?

Updated: Category: Javascript
Author: Member Level: GoldPoints: 15

In this artical i'm trying to explain CheckBox SelectAll and DeSelectAll. In my page header itself i have a CheckBox Control once i click on that header checkbox all checkboxes in DataRow need to checked. Again i click on Header Checkbox need to deselect all checkboxes.

CheckBox SelectAll / DeSelectAll

In this artical i'm trying to explain how to select all checkboxes and how to deselect all checboxes using single click.
For this i'm introducing Javascript function using this javascript function easy to select all checkboxes and deselect all checkboxes and call that javascritp function in control itself.


for Select and DeSelect All CheckBoxes purpose i wrote some javascript function. Use below lines of code.

< script type="text/Javascript" >

function Check(parentChk,container)
var elements = document.getElementsByTagName("INPUT");
for(i=0; i {
if(parentChk.checked == true)
if( IsCheckBox(elements[i]) && IsMatch(elements[i].id,container))
elements[i].checked = true;
if( IsCheckBox(elements[i]) && IsMatch(elements[i].id,container))
elements[i].checked = false;
< script>

Source code

Call that Javascript function in header control checkbox.

<asp:GridView ID="GV" runat="server" ShowFooter="false" Width="100%"
EnableModelValidation="True" ForeColor="#333333"
GridLines="Vertical" AutoGenerateColumns="false" >

<asp:TemplateField >
<input id="HchkSelect" type="checkbox" onclick="javascript:Check(this,'GV');" />
<asp:CheckBox ID="chkSelect" runat="server" />
<ItemStyle HorizontalAlign="center" />

Select/Deselect All

Did you like this resource? Share it with your friends and show your love!

Article by naveensanagasetti
I hope you enjoyed to read my article, If you have any queries out of this then please post your comments.

Follow naveensanagasetti or read 138 articles authored by naveensanagasetti
Responses to "CheckBox SelectAll / DeSelectAll using Javascript...?"
Guest Author: Arecg   19 Sep 2013
When you watch the Texans’ DE play, its easy to be impressed with his athletic ability, speed up the field and his power at the point of attack. That’s legit talent right there. But let’s not forget about the technique Watt displays with his hands. He can “press” an offensive lineman and create some separation to work his counter moves. Fast and violent with the hands. That’s what I took from the game. CSS10-26


Post Comment:

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)

    Type the numbers and letters shown on the left.

    Submit Article     Return to Article Index
    Subscribe to Subscribers
    Active Members
    TodayLast 7 Daysmore...

    Awards & Gifts
    Talk to Webmaster Tony John
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India