zoukankan      html  css  js  c++  java
  • document.form.command.value

    问题:在一个JSP页面中需要多个提交按钮,每个按钮点击后需要把同一个form提交到不同的页面进行处理

    解决:用JS。

    <html>
    <head>
    <title>一个表单、多个提交按钮、提交到多个不同页面</title>
    </head>

    <script>
    function sm1(){
       document.getElementByIdx("form1").action="1.jsp";
       document.getElementByIdx("form1").submit();
    }
    function sm2(){
       document.getElementByIdx("form1").action="2.jsp";
       document.getElementByIdx("form1").submit();
    }
    </script>

    <body>
    <form action="" method="post" id="form1">
     <input name="mytext" type="text" id="mytext" />
     <input name="bt1" type="button" id="bt1" value="提交到1.jsp" onclick="sm1()" />
     <input name="bt2" type="button" id="bt2" value="提交到2.jsp" onclick="sm2()" />
    </form>
    </body>
    </html>

  • 相关阅读:
    Class attributes
    Card objects
    Exercises
    Type-base dispatch
    Operator overloading
    The str method
    loadrunner协议开发
    nmon分析与详解
    如何判断CPU、内存、磁盘的性能瓶颈?
    用友NC客户端地址
  • 原文地址:https://www.cnblogs.com/qingsong/p/5094048.html
Copyright © 2011-2022 走看看