function setCheckBoxSelect(idPrefix)
{
var theBox = document.getElementById(idPrefix);
var elem = document.getElementsByTagName('input');
if(theBox.checked)
{
for(i = 0;i< elem.length; i++)
{
if(elem[i].type=='checkbox' && elem[i].id.indexOf(idPrefix) > -1)
{
elem[i].checked = true;
if(elem[i].id.indexOf('_Cur') >-1)
{
document.getElementById(elem[i].id.replace('_Cur','_Pri')).checked = false;
}
else
{
document.getElementById(elem[i].id.replace('_Pri','_Cur')).checked = false;
}
}
}
}
else
{
for(i = 0;i< elem.length; i++)
{
if(elem[i].type=='checkbox' && elem[i].id.indexOf(idPrefix) > -1)
{
elem[i].checked = false;
if(elem[i].id.indexOf('_Cur') >-1)
{
document.getElementById(elem[i].id.replace('_Cur','_Pri')).checked = true;
}
else
{
document.getElementById(elem[i].id.replace('_Pri','_Cur')).checked = true;
}
}
}
}
return false;
}
//]]>
</script>
转载于:https://www.cnblogs.com/Devil_Nic/archive/2010/06/02/1749720.html