<FORM METHOD=POST ACTION=""> <input type="password" id="input1"> <input type="password" id="input2"> <input type="button" value="test" onclick="check()"> </FORM> <script> function check() { with(document.all){ if(input1.value!=input2.value) { alert("false") input1.value = ""; input2.value = ""; } else document.forms[0].submit(); } } </script> |