deselect/select checkbox

admin

Administrator
Staff member
I have a list of 300 checkboxes (all checked) and I use a standard javascript deselect function and it takes 2 seconds for the deselect to complete. I then have a list of 600 checkboxes(all checked) and I hit deselect and it takes 8 seconds to deselect. 900 takes 13 seconds and so on.

My question is: why does it take longer to deselect the total list the more I add. I would of expected to see.

300 - 2 seconds
600 - 4 seconds
900 - 6 seconds

This is a performance issue with my web application.

function selectAll()
{
if (criteriaSummary.document.form1.checklist != null)
{
if (criteriaSummary.document.form1.checklist.length > 1)
{
for(var i=0;i<criteriaSummary.document.form1.checklist.length;i++)
{
if(criteriaSummary.document.form1.checklist.type == "checkbox")
{
criteriaSummary.document.form1.checklist.checked = true;
}
}
}
else
{
criteriaSummary.document.form1.checklist.checked = true;
}
}
}

function deSelectAll()
{
if (criteriaSummary.document.form1.checklist != null)
{
if (criteriaSummary.document.form1.checklist.length > 1)
{
for(var i=0;i<criteriaSummary.document.form1.checklist.length;i++)
{
if(criteriaSummary.document.form1.checklist.type == "checkbox")
{
criteriaSummary.document.form1.checklist.checked = false;
}
}
}
else
{
criteriaSummary.document.form1.checklist.checked = false;
}
}
}
 
Back
Top