reaaaaal dumb question regarding checking the value of check boxes
Hello all,
quite the newbie. I have a question about an interactive form that I
created. Basically I have 10 check boxes, and I want to hide, display
certain div tags based on the check boxes selected. Below I'm having
it display one div and hide another if you select the checkbox st_10.
My goal is to have one text box appear if they click no check boxes,
and another is they check even 1 out of 10. How can I go about this
without replicating the bottom code for each check box instance? I
feel if I actually did that, a programmer somewhere in the world would
show up at my door and smack me over the head with a printed out
jQuery manual.
thanks in advance.
$("#submit").click(function(){
var numSelect = $("input[name='st_10']:checked").val();
if(numSelect == '1') {
$("#yesBox").show();
$("#noBox").hide();
} else {
$("#yesBox").hide();
$("#noBox").show();
}
$("showMessage").show();
return false;
}); //end Submit