I have the following scenario in my program. In my HTML side of my code, I have something like the following;
<form name=manifest>
<input type=checkbox name=include0 value=YES>
<input type=checkbox name=include1 value=YES>
<input type=checkbox name=include2 value=YES>
<input type=checkbox name=include3 value=YES>
<input type=hidden name=listcount value=4>
</form>
I'm trying to write a function, that when the user clicks a button on the page that it will invoke this function, and invert the checked boxes, if checkboxes 1,2,3 are check, and 4 is not, then 1,2,3 should become uncheck, and 4 should check.
Believe me, I know that one I have isn't written correctly, but i'm not sure HOW to write it. Can anyone make the appropriate corrections to my code? I would be forever grateful.
function invertmarking() {
with (parent.data.document.manifest) {
for (i=0; i<parseInt(listcount.value)-1; i++) {
if (include + i.checked == true) {
include + i.checked == false;
} else if (include + i.checked == false) {
include + i.checked == true;
}
}
}
}
Many thanks,
Panthaur
<form name=manifest>
<input type=checkbox name=include0 value=YES>
<input type=checkbox name=include1 value=YES>
<input type=checkbox name=include2 value=YES>
<input type=checkbox name=include3 value=YES>
<input type=hidden name=listcount value=4>
</form>
I'm trying to write a function, that when the user clicks a button on the page that it will invoke this function, and invert the checked boxes, if checkboxes 1,2,3 are check, and 4 is not, then 1,2,3 should become uncheck, and 4 should check.
Believe me, I know that one I have isn't written correctly, but i'm not sure HOW to write it. Can anyone make the appropriate corrections to my code? I would be forever grateful.
function invertmarking() {
with (parent.data.document.manifest) {
for (i=0; i<parseInt(listcount.value)-1; i++) {
if (include + i.checked == true) {
include + i.checked == false;
} else if (include + i.checked == false) {
include + i.checked == true;
}
}
}
}
Many thanks,
Panthaur