不同的按钮提交到同一个地址,只是地址所带的参数值不一样的HTML和JS语句

方法一:<include file="public:header"/>
<style type="text/css">
.table_list .hightlight{color:red;}
</style>
<link rel="stylesheet" href="/js/calendar/calendar-blue.css"/>
<script type="text/javascript" src="/js/calendar/calendar.js"></script>
<script type="text/javascript">
$(document).ready(function(){
Calendar.setup({
inputField : "omonth1",
ifFormat : "%Y-%m-01",
showsTime : false,
});
$("#paygame").combobox({
url:"{:U('ajax/games')}",
valueField:'game_id',
textField:'game_name',
width:120,
onSelect:function(res){
$("#paygame").val(res.game_id);
}


});


});
function export_file($num){
$("#subfm").attr("action",$("#subfm").attr("action")+'&type='+$num).submit();
}
</script>
<div class="pad_lr_10">
<form name="searchform" method="post" action="{:U('difference/index')}" target="_blank" id="subfm">
        <table width="100%" cellspacing="0" class="search_form" >
            <tbody>
                <tr>
                    <td>
                    <div class="explain_col">
                                                        所属月份:<input type="text" name="omonth" value="" id="omonth1" class="date input-text" style="width:80px">  
  所属游戏:<input type="text" name="gid" value="" id="paygame" class="input-text"/>                          
&nbsp;&nbsp;<input class="btn"  type="button" οnclick="export_file(1);" value="财务与游戏方都存在的订单">
&nbsp;&nbsp;<input class="btn"  type="button" οnclick="export_file(2);" value="财务比游戏方少的当月不存在的订单">
&nbsp;&nbsp;<input class="btn"  type="button" οnclick="export_file(3);" value="财务比游戏方少的在其他月份存在订单">
&nbsp;&nbsp;<input class="btn"  type="button" οnclick="export_file(4);" value="财务比游戏方少的,在我方也不存在的订单">
                        </div>
  </td>
                </tr>
            </tbody>
        </table>
    </form>
</div>
<include file="public:footer" />
</body>

</html>



方法二:

<include file="public:header"/>
<style type="text/css">
.table_list .hightlight{color:red;}
</style>
<link rel="stylesheet" href="/js/calendar/calendar-blue.css"/>
<script type="text/javascript" src="/js/calendar/calendar.js"></script>
<script type="text/javascript">
$(document).ready(function(){
Calendar.setup({
inputField : "omonth1",
ifFormat : "%Y-%m-01",
showsTime : false,
});
$("#paygame").combobox({
url:"{:U('ajax/games')}",
valueField:'game_id',
textField:'game_name',
width:120,
onSelect:function(res){
$("#paygame").val(res.game_id);
}


});


});


function export_file1(){
$("#subfm").attr("action", "{:U('difference/index?type=1')}").submit();
}
function export_file2(){
$("#subfm").attr("action", "{:U('difference/index?type=2')}").submit();
}
function export_file3(){
$("#subfm").attr("action","{:U('difference/index?type=3')}").submit();
}
function export_file4(){
$("#subfm").attr("action","{:U('difference/index?type=4')}").submit();
}

</script>
<div class="pad_lr_10">
<form name="searchform" method="post" action="{:U('difference/index')}" target="_blank" id="subfm">
        <table width="100%" cellspacing="0" class="search_form" >
            <tbody>
                <tr>
                    <td>
                    <div class="explain_col">
                                                        所属月份:<input type="text" name="omonth" value="" id="omonth1" class="date input-text" style="width:80px">  
  所属游戏:<input type="text" name="gid" value="" id="paygame" class="input-text"/>                          
&nbsp;&nbsp;<input class="btn"  type="button" οnclick="export_file1();" value="财务与游戏方都存在的订单">
&nbsp;&nbsp;<input class="btn"  type="button" οnclick="export_file2();" value="财务比游戏方少的当月不存在的订单">
&nbsp;&nbsp;<input class="btn"  type="button" οnclick="export_file3();" value="财务比游戏方少的在其他月份存在订单">
&nbsp;&nbsp;<input class="btn"  type="button" οnclick="export_file4();" value="财务比游戏方少的,在我方也不存在的订单">
                        </div>
  </td>
                </tr>
            </tbody>
        </table>
    </form>
</div>
<include file="public:footer" />
</body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值