<!DOCTYPE html>
<html >
<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 οnclick="wei()"/>微信支付</button>
<button οnclick="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="發送" οnclick="send();">
<input type="button" name="btn2" value="儲存" οnclick="save();">
</form>