try to get from this simle code :
<html>
<head>
<title>Untitled</title>
<script type="text/javascript">
function checkit(){
if(!document.getElementById("cid").checked){
alert("Check the checkbox")
}
else{
a.submit();
}
}
</script>
</head>
<body><form id="form1">
<input type="checkbox" id="cid"/>
<input type="button" value="Submit" onclick="javascript:checkit();"/>
</form>
</body>
</html>