<script type="text/javascript" language="javascript"> //-------------------function hardcode to perform on checklist box-------- var total = 0; var histvalue = 0; var valueOfbx = 0; var currvalue = 0; function MutExChkList(chk) { if (chk.checked) { valueOfbx = 0; var chklst = chk.parentNode.parentNode.parentNode; var chkbx = chklst.getElementsByTagName("input"); for (var i = 0; i < chkbx.length; i++) { if ((chkbx[i].checked == true) && (chkbx[i].value != chk.value)) { valueOfbx = Number(chkbx[i].value); histvalue = -1; chkbx[i].checked = false; } else if ((chkbx[i].checked == true) && (chkbx[i].value == chk.value)) { currvalue = Number(chkbx[i].value); } } total = total + currvalue; if (histvalue == -1) { total = total - valueOfbx; histvalue = 0; } if (total > 1) { total = total - Number(chk.value); chk.checked = false; alert("exceeds"); } else chkbx[i].checked = false; } else { total = total - Number(chk.value); } } </script>
var chklst = chk.parentNode.parentNode.parentNode;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)