zoukankan      html  css  js  c++  java
  • 一个form表单有两个按钮,分别提交到不同的页面

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>支付测试模板</title>
    </head>
    <body>
    <form action="" name="pay" method="post" enctype="multipart/form-data">
        评估类型:<input type="text" name="assess_type"/><br/>
        购买年限:<input type="text" name="assess_year"/><br/>
        邀请码数量:<input type="text" name="code_num"/><br/>
        购买年限:<input type="text" name="report_year"/><br/>
        是否开发票:<input type="text" name="report_bill"/><br/>
        姓名:<input type="text" name="report_address_uname"/><br/>
        电话:<input type="text" name="report_address_mobile"/><br/>
        地址:<input type="text" name="report_address"/><br/>
        单价:<input type="text" name="price"/><br/>
        数量:<input type="text" name="num"/><br/>
        总金额:<input type="text" name="total_fee"/><br/>
        <button onclick="wei()"/>微信支付</button>
        <button onclick="zhi()"/>支付宝支付</button>
    </form>
    </body>
    </html>
    
    <script>
        function wei(){
    //        document.("表单的name值").action
    //        document.("表单的name值").submit
            document.pay.action="{:U('Home/Payment/getQrcode')}";
            document.pay.submit();
        }
        function zhi() {
            document.pay.action = "{:U('Home/Payment/doalipay')}";
            document.pay.submit();
        }
    </script>

    或者:

    <script language="javascript">
    function save(){ 
        document.form1.action="right.asp";
        document.form1.submit();
    }
    function send(){
        document.form1.action="sendtaskook.asp";
        document.form1.submit();
    }
    </script>
    <form name="form1">
    <input type="button" name="btn1" value="发送" onclick="send();">
    <input type="button" name="btn2" value="保存" onclick="save();">
    </form>

  • 相关阅读:
    Android 系统日期时间的获取
    Android What is Application
    Android 所有颜色代码
    Android onNewIntent
    Android Activity管理类
    Android 应用启动渐变效果
    算法的的代价及其度量
    算法的设计与分析
    算法的描述
    数据结构与算法(python版)教程
  • 原文地址:https://www.cnblogs.com/xieyunc/p/9126449.html
Copyright © 2011-2022 走看看