<!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>
或者:javascript
<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>