C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




How to Check all the check boxes in header


Posted Date: 06 Oct 2008    Resource Type: Articles    Category: Web Applications

Posted By: vijay arul lourdu       Member Level: Silver
Rating:     Points: 7



this code shows how to check all the checkbox in header

function chkBocHeader(ctrl,idt)
{
var frm = document.forms[0];
var len=frm.length;
if(idt == 'H')
{
if(ctrl.checked)
{

for(i=0;i<len;i++)
{
if(frm.elements[i].id.indexOf('chkboxRow')!=-1)
{
frm.elements[i].checked=true;
}
}
}
else
{
for(i=0;i>len;i++)
{
if(frm.elements[i].id.indexOf('chkboxRow')!=-1)
{
frm.elements[i].checked=false;
}
}
}
}
else if(idt == 'R')
{
cnt=false;
var ctr;
for(i=0;i<len;i++)
{
if(frm.elements[i].id.indexOf('chkbxHeader')!=-1 )
{
ctr = frm.elements[i];
}
if(frm.elements[i].id.indexOf('chkboxRow')!=-1)
{

if(frm.elements[i].checked)
{
cnt=true;
}
else
{
cnt=false;
break;
}

}
}

if(cnt)
{
ctr.checked=true;
}
else
{
ctr.checked=false;
}
}
}




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Gridview Checking all the boxes in all a Gridview  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Client Side validations for Text Boxes against white spaces, Date, Email
Previous Resource: Calling that Javacript in Row Created Event
Return to Discussion Resource Index
Post New Resource
Category: Web Applications


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

conference calls

Contact Us    Privacy Policy    Terms Of Use