It seems to do what I want sort of, but has error if you uncheck a box and also only one box should beable to be checked.
I created radio buttons insted and it does good, now my question is how do I hide the last radio button in the form.
and since I created a form and it made a sql database will changing the checkboxes on the for to radio buttons affect the database information for the checkboxes
<html>
<head>
<script type="text/javascript">
function addVal(newVal, dest, addOrRemove) {
if (addOrRemove) { // true == add; false == remove;
if (dest.value.length != 0) {
dest.value= "";
}
dest.value += newVal;
} else {
dest.value.replace(new RegExp("[, ]?" + value, "ig"), "");
}
}
</script>
</head>
<body>
<form ...>
<input type="text" name="AmountEnclosed" id="AmountEnclosed" value="" />
<input type="radio" value="$45.00" name="R1"onclick="addVal(this.value, this.form.AmountEnclosed, this.checked)" />
<input type="radio" name="R1" value="$20.00"onclick="addVal(this.value, this.form.AmountEnclosed, this.checked)" />
<input type="radio" name="R1" value="$60.00"onclick="addVal(this.value, this.form.AmountEnclosed, this.checked)" />
<input type="radio" name="R1" value="0" checked class="hidden"></form>
</body>
</html>