<script language="javascript">
function aa(a,b){
if(a.value=="" && b.value==""){alert("on");return false;}
}
</script>
<form name="form1" onsubmit="return aa(aa_1,aa_2)">
<input type="text" name="aa_1">
<input type="text" name="aa_2">
<input type="submit" value="submit">
</form>