页面代码:
<html>
<head>
<script>
 function go(){}
</script>
</head>
<body>
<input type="text" name="a1" />    <input type="text" name="a4" />
<input type="text" name="a2" />    <input type="text" name="a5" />
<input type="text" name="a3" />    <input type="text" name="a6" />
<input type="submit" onclick="Javascript:go();" />
</body>
</html>
我要的效果是:当a1、a4、a5值不为空的时候才能提交,在怎么写。在不改变页面的情况下。
另外问下我页面引用jquery文件后就该页面就无法打开了,怎么回事啊,求解?

解决方案 »

  1.   

    <input type="submit" onclick="return Javascript:go();" />
    ---------------------------------
    function go() {
        if (...) {
            return true;
        } else {
            return false;
        }
    }
      

  2.   

    if( $("input[name='a1']").val() !=''&&$("input[name='a1']").val() !=''&&$("input[name='a1']").val() !=''){
              $("form").submit()//提交
    }else{
             return false;
    }
      

  3.   

    我也知道用jquery怎么判断 但是问题是jquery文件引入进去 页面就打不开了  用javascript  怎么写  求详细 
      

  4.   

    根据ID获取吧document.getElementsById
      

  5.   

    <input id="a1" type="text" name="a1" value=""/>
    document.getElementById("a1").value != ""
      

  6.   

    javascript  bug 查找一下 看看什么错误,从网上找找吧 有插件的 不行用火狐IE
      

  7.   

    不+id 就根据name 可以得到嘛  
      

  8.   

    <input type="submit" onclick="return Javascript:go();" />
    ---------------------------------
    function go() {
      if (...) {
      return true;
      } else {
      return false;
      }
    }
      

  9.   

    document.getElementsByName("a1")[0];