js 在一个页面两个submit 提交同一个form 到不同的action

  <script type="text/javascript">

  function changeURL(type,resultID)

{

var action = "";

if(type == "update")

{

action = "actions/modifyRecordAction!updateInput?document.id=" + resultID;

window.location.href=action;

}

if(type == "submit")

{

if (confirm("确定要提交到TMS吗!")) {

action = "actions/declareAction!submitInput?document.id=" + resultID;

window.location.href=action;

}

}

}

</script>

<div align="center" style="margin:10 10 10 10">

<input type="button" value=" 提&nbsp;交 " onClick="changeURL('submit',${document.id})"; src="images/system/5.gif" width="48" height="19">&nbsp;&nbsp;&nbsp;

<input type="button" value=" 修&nbsp;改 " onClick="changeURL('update',${document.id})"; src="images/system/5.gif" width="48" height="19">

</div>

--------------------------------------------------------------------------------

 <script type="text/javascript">

  function changeURL(resultID)

{    

// alert(document.forms["targetForm"].action);

document.forms["targetForm"].action="actions/modifyRecordAction!saveSubmitNext?document.id=" + resultID;

return true;

}

</script>

<form id="targetForm">

<input  type="submit" src="images/system/5.gif" value="保存并提交到下一步" id="saveSubmitNext" onClick="return changeURL(${document.id})">

原文地址:https://www.cnblogs.com/java20130726/p/3218428.html