日期:2014-05-17 浏览次数:20686 次
<form action="" method="post"> <input type="button" onclick="metho()"> </form>
<script type="text/javascript"> function metho() { var dForm = document.getElementById("dForm"); dForm.action = "process.do"; dForm.submit(); } </script> <form action="" method="post" id="dForm> <input type="button" onclick="metho()"> </form>
------解决方案--------------------
<script type="text/javascript"> function metho() { var dForm = documentforms[0]; dForm.action = "url"; dForm.submit(); } </script> <form action="" method="post"> <input type="button" onclick="metho()"> </form>
------解决方案--------------------
<script type="text/javascript">
function metho() {
var dForm = document.getElementById("dForm");
dForm.action = "process.do";
dForm.submit();
}
</script>
<form action="" method="post" id="dForm>
<input type="button" onclick="metho()">
</form>
-->等价于
<form action="process.do" method="post" id="dForm>
<input type="submit" />
</form>
上面的绕道到js里面提交到process.do