Click to See Complete Forum and Search --> : deselect/select checkbox


mwikoff
12-19-2002, 01:56 PM
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[i].type == "checkbox")
{
criteriaSummary.document.form1.checklist[i].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[i].type == "checkbox")
{
criteriaSummary.document.form1.checklist[i].checked = false;
}
}
}
else
{
criteriaSummary.document.form1.checklist.checked = false;
}
}
}

khalidali63
12-19-2002, 03:56 PM
The best thing will be to post your methods that select or deselect the checkboxes and how those methods are initiated.
Then it will be easy to look at them and respond

Khalid