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})">

  • 相关阅读:
    Linux下安装mysql(yum和源码编译两种方式)
    搭建Hadoop集群(centos6.7+hadoop-2.7.3)
    xen虚拟机(Centos6.6)的创建和扩容
    Apache Ranger对HDFS的访问权限控制的原理分析(一)
    Block Token 原理分析
    Hadoop安全机制之令牌
    VS 2012 Unit Test
    java 并发
    图片相关
    cmd出现乱码
  • 原文地址:https://www.cnblogs.com/java20130726/p/3218428.html
Copyright © 2011-2022 走看看