本文主要是介绍不同的按钮提交到同一个地址,只是地址所带的参数值不一样的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"/>
<input class="btn" type="button" οnclick="export_file(1);" value="财务与游戏方都存在的订单">
<input class="btn" type="button" οnclick="export_file(2);" value="财务比游戏方少的当月不存在的订单">
<input class="btn" type="button" οnclick="export_file(3);" value="财务比游戏方少的在其他月份存在订单">
<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"/>
<input class="btn" type="button" οnclick="export_file1();" value="财务与游戏方都存在的订单">
<input class="btn" type="button" οnclick="export_file2();" value="财务比游戏方少的当月不存在的订单">
<input class="btn" type="button" οnclick="export_file3();" value="财务比游戏方少的在其他月份存在订单">
<input class="btn" type="button" οnclick="export_file4();" value="财务比游戏方少的,在我方也不存在的订单">
</div>
</td>
</tr>
</tbody>
</table>
</form>
</div>
<include file="public:footer" />
</body>
</html>
这篇关于不同的按钮提交到同一个地址,只是地址所带的参数值不一样的HTML和JS语句的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!