把那个SUBMIT按钮的TYPE改为BUTTON
<form method="Post" action="xxx.asp" NAME=“FORM”>
    <input type="text" name="txtTest"></form>
FUNCTION SUBMITFORM(){
if(document.all("txtTest").length==0){
      alert("txtTest必须添写!!非法字段");
}
ELSE {
 DOCUMENT.FORM.SUBMIT()
}