Put a JS in your page. Change the form tag to include onsubmit then return the result of a function that tests the vals.
<script type="javascript">
function testForm()
{
...
return true;
}
</script>
<form id="myform" önsubmit="return testForm();" action="submit.aspx">
...
...
...
</form>