with(yourForm){
if(text1.value=="sent"&&text2.value==""){
alert("出错");event.returnValue=false;
}
//.....
}

解决方案 »

  1.   

    未测试,明白思路即可function check(){
    with(yourForm){
    arr3=text3.value.slice(1,-1).split(",")
    arr4=text4.value.slice(1,-1).split(",")
    for(i=0;i<arr3.length;i++)for(j=0;j<arr4.length;j++)
    if(arr3[i]==arr4[j]){alert("出错");return false;}
    return true;
    }
    }
      

  2.   

    第一个都不行呀;
    function form_check()
    {if (document.FORM1.action.value =="send" &&document.FORM1.apptxt=="")  {
         alert("错误");
         return false
      }
     return true;
    }
    其中:<input name=action type=hidden value=send>
      

  3.   

    <input name=action type=hidden value=send>
    不要用action做name,和form的action重复啊。。
    也可以这样:
    document.FORM1.elements["action"]=="send"
      

  4.   

    document.FORM1.elements["action"].value=="send"
      

  5.   

    function form_check()
    {if (document.FORM1.elements["action"].value =="send" &&document.FORM1.apptxt.value=="")  {
         alert("错误");
         return false
      }
     return true;
    }