<input type="button" name="hh" value="ok" onclick="aa();">~~

解决方案 »

  1.   

    楼上的方法可以实现了
    还可以有另一种:
    <form method="post" action="a.html" name="a" onsubmit="aa();return false;">
    <input type="submit" name="hh" value="ok" >
    <script>
    function aa(){window.location="b.html";}
    </script>
    </form>你还可以在aa()方法里面对表单进行一些校验
      

  2.   

    还有一种方法:
    <form method="post" action="a.html" name="a">
    <input type="button" name="hh" value="ok" onclick="aa()">
    <script>
    function aa(){
      window.document.a.action="b.html" ;
    //这里加上你的校验代码(如果需要的话)  a.submit();   
     }
    </script>这样作的好处是:数据传递方式是post,在地址栏理看不到你传的参数。
    </form>