I have been searching for a few check box solutions, and think I need to write an method that runs when the user presses the submit button

Code:
  <script type="text/javascript">
function validate(form) {

var total=""
for(var i=0; i < 2; i++){
if(document.form1.id[i].checked)
total +=document.form1.id[i].value + "\n"
}
if(total==""){
alert("Please select an option")
}
else
alert ("The options you have selected are: "+"\n"+total)

return false;
} </script>