当前位置:Gxlcms > JavaScript > from表单多个按钮提交用onclick跳转不同action

from表单多个按钮提交用onclick跳转不同action

时间:2021-07-01 10:21:17 帮助过:2人阅读

代码如下:

<form name="form1" method="post" action="ad/BusinessAction!list.action">

//下面input框提交的action不同,用onclick跳转,写一个js方法

<input type="button" class="mulButton" name="Ids" id="allcheck" onclick="manySend('ad/BusinessAction!sendmany.action')" value="批量导入到成功案例"/>

<script>

//js方法如下

function manySend(href){
var form = document.form1;
form.action = href;//传想要跳转的路径
form.submit();
}

</script>

人气教程排行