<form action="*" method="post" onSubmit="return check()">
</form>
<script>
function check(){
if(条件)
{return:false}
else{return:true}
}
</script>
或者:
<form action="*" method="post" onSubmit=" check()">
</form>
<script>
function check(){
window.event.returnValue = false;
}
</script