zoukankan      html  css  js  c++  java
  • 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})">

  • 相关阅读:
    PHP+JQUEY+AJAX实现分页
    Flume知识扩展
    Flume高级之自定义MySQLSource
    Flume监控之Ganglia
    Flume 概述/企业案例
    Yarn (转自之乎者也)
    MapReduce如何解决数据倾斜?
    JVM调优
    Hive性能优化
    HBase的二级索引
  • 原文地址:https://www.cnblogs.com/java20130726/p/3218428.html
Copyright © 2011-2022 走看看