C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » C# Syntax »

Check UnCheck The Checkboxes


Posted Date: 26 Dec 2008    Resource Type: Code Snippets    Category: C# Syntax
Author: SumitMember Level: Silver    
Rating: 1 out of 5Points: 7





function CheckUncheck()
{
var checkAll=false;
var checkNotAll=false;
var LIntCtr;
var LIntSelectedCheckBoxes=0;

for (LIntCtr=0; LIntCtr < document.forms[0].elements.length; LIntCtr++)
{
if ((document.forms[0].elements[LIntCtr].type == 'checkbox') && (document.forms[0].elements[LIntCtr].name.indexOf('chkProduct') > -1))
{
if(document.forms[0].elements[LIntCtr].checked == true)
{
checkNotAll=true;
LIntSelectedCheckBoxes = parseInt(LIntSelectedCheckBoxes) + 1;
}
else
{
checkNotAll=false;
//alert('all not chacked');
//alert(document.getElementById("Checkbox1").checked);
document.getElementById("Checkbox1").checked = false;
return;
}
}
}
if(checkNotAll==false )
{
//alert('all not chacked');
document.getElementById("Checkbox1").checked=true;
}
else
{
//alert('all chacked');
document.getElementById("Checkbox1").checked=true;
}
}



To Check UnCheck The Checkboxes



Responses


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

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Books  .  

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: Naming Conventions and Standards
Previous Resource: how to use trim function
Return to Discussion Resource Index
Post New Resource
Category: C# Syntax


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use