keeping a checkmark after save

wxdqz

New Member
The attached code is intended to allow one chekmark at a time.
When a check is placed on a checkbox, the next checkbox is enabled and the subsequent ones are disabled.
It works great but I have been trying to make one minor change to the code with little success.
When I place a check on a checkbox and click the save button, that checkbox that I just checked is unchecked.
Can someone help make this adjustment so that whenever a check is placed on a checkbox and a save button is clicked, next time you open this page, that check on any given checkbox is retained.
Thanks in advance and here is the current working code.

<HTML>
<HEAD>
<TITLE>enable</TITLE>
<script language="javascript">
<!--
var numOfBoxes = 8;
function enable(inBox) {
if (!document.forms['myForm']['cb' + inBox].checked) {
// If the user unchecked a box, then disable all after it
for (var i = inBox + 1; i <= numOfBoxes; i ++) {
document.forms['myForm']['cb' + i].checked = false;
document.forms['myForm']['cb' + i].disabled = true;
}
}
else {
// User checked a box, so enable the next
document.forms['myForm']['cb' + (inBox+1)].disabled = false;
}
}
//-->
</script>

</HEAD>
<BODY>
<form name="myForm">
<table>
<tr>
<td>Identify Objectives
<input type="checkbox" name="cb1" id="cb1" onClick="enable(1)">

Evaluate Requirements
<input type="checkbox" name="cb2" id="cb2" onClick="enable(2)" DISABLED>

Design
<input type="checkbox" name="cb3" id="cb3" onClick="enable(3)" DISABLED>


Initial Draft
<input type="checkbox" name="cb4" id="cb4" onClick="enable(4)" DISABLED>

Review
<input type="checkbox" name="cb5" id="cb5" onClick="enable(5)" DISABLED>

Revision
<input type="checkbox" name="cb6" id="cb6" onClick="enable(6)" DISABLED>

Final Production
<input type="checkbox" name="cb7" id="cb7" onClick="enable(7)" DISABLED>

Documentation
<input type="checkbox" name="cb8" id="cb8" DISABLED>
</td>

</tr>
</table>
</form>
</BODY>
</HTML>
 
Back
Top