Blog Image

Check or uncheck multiple checkbox at a time in javascript

function checkUncheckAllCheckbox()
{
f=document.frmName
if(f.mainCheckBox.checked)
{
f.checkBoxName.checked=true;
for(i=0;i<f.checkBoxName.length;i++)
f.checkBoxName[i].checked=true;
}
else if(!f.mainCheckBox.checked)
{
f.checkBoxName.checked=false;
for(i=0;i<f.checkBoxName.length;i++)
f.checkBoxName[i].checked=false;
}
}



Author: admin

Vinod Ram has been in Software Industry since 2006 and has experience of over 16 years in Software Development & Project Management domain specialised majorly in LAMP stack & Open Source Technology, building enterprise level Web based Application, Large Database driven and huge traffic Websites and Project Management. He loves to write information articles and blog to share his knowledge and experience with the outside world and help people to find solution for their problems.