How to select or deselect the same checkboxes on two forms?
The example shows how to check or uncheck a checkboxes in one form and the checkboxes in another form will be checked or unchecked as well.<html>
<head>
<script>
function CheckAll()
{
count = document.frm1.elements.length;
for (i=0; i < count; i++)
{
if(document.frm1.elements[i].checked == 1)
{document.frm2.elements[i].checked = 1; }
else {document.frm2.elements[i].checked = 0;}
}
}
</script>
</head>
<body>
<form name="frm1">Form 1
<input type="checkbox" onclick="CheckAll()" value="Check All"/>
<input type="checkbox" onclick="CheckAll()" value="Check All"/>
<input type="checkbox" onclick="CheckAll()" value="Check All"/>
<input type="checkbox" onclick="CheckAll()" value="Check All"/>
<input type="checkbox" onclick="CheckAll()" value="Check All"/>
</form>
<form name="frm2">Form 2
<input type="checkbox" />
<input type="checkbox" />
<input type="checkbox" />
<input type="checkbox" />
<input type="checkbox" />
</form>
</body>
</html>Related threads:
Copy checkboxes' value
JavaScript FAQ
Sponsored links
Build IT Knowledge with Current & Trusted Content
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.
Check Out IT Certification Preparation Materials
Sign Up With SkillSoft & Get Access to Training Materials for Over 50 Professional Certifications.
Sign Up With SkillSoft & Get Access to Training Materials for Over 50 Professional Certifications.
Six Sigma Certification
100% Online-Six Sigma Certificate from Villanova - Find Out More Now.
100% Online-Six Sigma Certificate from Villanova - Find Out More Now.
Web based bug tracking - AdminiTrack.com
AdminiTrack offers an effective web-based bug tracking system designed for professional software development teams.
AdminiTrack offers an effective web-based bug tracking system designed for professional software development teams.
Computer Professionals: Are you owed Overtime?
Federal and State Laws may allow computer professionals to collect overtime. Our law firm is experienced, and has initiated class action lawsuits against some of the largest computer companies to collect back pay and overtime. Strictly Confidential.
Federal and State Laws may allow computer professionals to collect overtime. Our law firm is experienced, and has initiated class action lawsuits against some of the largest computer companies to collect back pay and overtime. Strictly Confidential.
