If you want to keep it simple, and know the ID's of the 4 check boxes, try:
<script language=javascript>
function isChecked(){
if (document.getElementById("
document.getElementById("c
document.getElementById("c
document.getElementById("c
else {doFunctionA()}
}
</script>
<form>
<input type="checkbox" id="checkbox1" value="Y" />
<input type="checkbox" id="checkbox2" value="Y" />
<input type="checkbox" id="checkbox3" value="Y" />
<input type="checkbox" id="checkbox4" value="Y" />
<input type="submit" value="click" onclick="isChecked()" />
</form>
Main Topics
Browse All Topics





by: stanscott2Posted on 2007-10-08 at 11:28:54ID: 20035915
Let's say that these are the only checkboxes on the page. then, you do this:
ame("input ");
function doSomething() {
var inp = document.getElementsByTagN
for (var t=0; t<inp.length; t++) {
if (inp[t].type=="checkbox" && inp[t].checked) {
doFunctionA();
return; // exit function
}
}
doFunctionB();
}