jquery 遍历 checkbox数组3 ; /workflow_2012_01_19/WebRoot/chinataxskskj/gbf/analyseQuerys.jsp
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%@ page contentType="text/html;charset=GB2312" %>
<%@page import="utils.system"%>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%@ page import="gov.chinatax.skskj.uservalidate.SkskjLogon"%>
<%@ page import="com.citichy.gbf.*"%>
<%@ page import="java.text.SimpleDateFormat" %>
<jsp:useBean id="login" scope="session"
class="gov.chinatax.skskj.uservalidate.SkskjLogon" />
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>工本费数据分析</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" href="../common/f1.css" type="text/css">
<link href="/css/gbf_style.css" rel="stylesheet" type="text/css" />
<style type="text/css"></style>
<script type="text/javascript" src="js/jquery.js"></script>
<script src="js/datelist.js"></script>
<script src="/chinataxskskj/js/yearData.js" charset="UTF-8"></script>
<script src="/js/showTree.js" charset="UTF-8"></script>
<script src="/js/swjg_dtree.js"></script>
<script type="text/javascript" src="/chinataxskskj/js/validateForm.js"></script>
<script type="text/javascript">
$(function(){
var test =document.getElementById('code').innerHTML= '<a style=\"font-size: 14px;\">发票种类码:</a><select id="typeCode" class="selector1" ><option value="00000" id="pz_00000"/> 全部票种</option><logic:iterate id="item" name="invTypes" ><option id="code_<bean:write name="item" property="code"/>" value=<bean:write name="item" property="code"/>> <bean:write name="item" property="code"/> <bean:write name="item" property="name"/></option></logic:iterate></select>' ;
/*
<input type="hidden" name="requestType" id="requestType" value="testRequest"/>
<input type="hidden" name="type" id="type" value="fs"/>
<input type="hidden" name="hy" id="hy" value="0"/>
<input type="hidden" name="pz" id="pz" value="00382"/>
<input type="hidden" name="swjg" id= "swjg" value="2220102"/>
*/
$("#yc").click(function(){
$('#type').val($('.selectorkj :selected').val()) ;
$('#pz').val($('.selector1 :selected').val());
$('#swjg').val($('#startswjgdm').val()) ;
if($('#type').val() == 'jh'){
$('#requestType').val('PLAN_REQUEST');
}else if($('#type').val() == 'fs') {
$('#requestType').val('SELL_REQUEST');
}
var checd_Count =$('input[type="checkbox"]:checked').length;
alert(checd_Count);
var a="";
$('input[type="checkbox"]:checked').each(
function() {
a+=$(this).val();
checd_Count--;
if(checd_Count != 0){
a +=',';
}
});
$('#hy').val(a);
});
$(":checkbox").click(function(){
var $checkCount =$(":checkbox ").length;
var $checkedCount =$('input:checked').length;
var num =parseInt($checkedCount);
var $cur_selct_val = $('#typeCode').val();
if((num >1) && ($cur_selct_val!='00000')){
alert("你选择了多个行业时,票种只能选择全部");
$('#pz_00000').attr("selected",true);
}
});
$('.selector1').click(function(){
var $checkCount =$(":checkbox ").length;
var $checkedCount =$('input:checked').length;
var num =parseInt($checkedCount);
var $cur_selct_val = $('#typeCode').val();
if((num >1) && ($cur_selct_val!='00000')){
alert("你选择了多个行业时,票种只能选择全部");
$('#pz_00000').attr("selected",true);
}
})
})// --jquery end
</script>
</head>
<body bgcolor="#FFFFFF" marginwidth="0" leftmargin="0" topmargin="0" background="../images/back.gif" marginheight="0">
<%@ include file="../common/banner.jsp" %>
<table width="1172" height="466" cellspacing="0" cellpadding="0" class="unnamed1" border="0" align="center" >
<tr>
<td height="466" valign="top" width="238">
<%@ include file="../common/ywgl_left.jsp"%>
</td>
<td valign="top" width="930">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" class="unnamed1">
<tr>
<td width="47%">
</td>
<td width="53%" align="right">
<font color="#999999">
当前位置:数据分析
</font>
</td>
</tr>
</table>
<br>
<br>
<div style="width: 920px;height: 466px;overflow: auto;">
<center>
<table width="700" border="0" cellspacing="0" cellpadding="0" bordercolordark=#ffffff bordercolorlight=#cccccc class="unnamed1">
<tr>
<td colspan="10" align="center"><font class="font14">数据分析及预测</font></td>
</tr>
</table>
<form action="/analyseDataAction.do?flag=testAction" method="post">
<table width="450" border="0" cellspacing="0" cellpadding="0" bordercolordark=#ffffff bordercolorlight=#cccccc class="unnamed1">
<tr class="font12">
<td colspan="2" align="left" valign="middle"> 税务机关:
<input name="startswjgmc" id="startswjgdm_displayName"
type="text" value="" readonly="readonly"
size="16" />
<input name="startswjgdm" id="startswjgdm" type="hidden"
value="" />
<input name="button2" type="button"
onclick="showswjgiframe('startswjgdm_div')" value="选择">
<br>
<div id="startswjgdm_div"
style="position: absolute; z-index: 2; display: none;">
<IFRAME name="hidefrm" marginWidth="0" marginHeight="0"
src="/chinataxskskj/datatransform/swjg.jsp?address=startswjgdm"
frameBorder="0" width="285" height="200" scrolling="yes"></IFRAME>
</div> </td>
</tr>
<tr>
<td>统计口径:
<select name="type" class="selectorkj">
<option value="jh">按计划统计</option>
<option value="fs">按发售统计</option>
</select>
</td>
<td>
季度:
<select name="jd">
<option value="0">
-------全选------- </option>
<option value="1">
-----第一季度----- </option>
<option value="2">
-----第二季度----- </option>
<option value="3">
-----第三季度----- </option>
<option value="4">
-----第四季度----- </option>
</select> </td>
</tr>
<tr>
<td>行业</td>
</tr>
<tr>
<td> 交通运输业:<input type="checkbox" value="1" id="hy1" name="hy1" />
</td>
<td>建筑业:<input type="checkbox" value="2" id="hy2" name="hy2" /></td>
</tr>
<tr>
<td> 金融保险业:<input type="checkbox" value="3" id="hy3" name="hy3" /></td>
<td>服务业:<input type="checkbox" value="7" id="hy7" name="hy7" /></td>
</tr>
<tr>
<td> 文化体育业:<input type="checkbox" value="5" id="hy5"name="hy5" /></td>
<td>娱乐业:<input type="checkbox" value="6" id="hy6" name="hy6" /></td></tr>
<tr>
<td> 邮电通信业:<input type="checkbox" value="4" id="hy4" name="hy4" /></td>
<td>转让无形资产:<input type="checkbox" value="8" name="hy8" id="hy8" /></td>
</tr>
<tr>
<td> 销售不动产:<input type="checkbox" value="9" id="hy9" name="hy9" /></td>
<td>综 合:<input type="checkbox" value="0" name="hy0" id="hy0" /></td>
</tr>
</table>
<table width="450" border="0" cellspacing="0" cellpadding="0" bordercolordark=#ffffff bordercolorlight=#cccccc class="unnamed1">
<tr>
<td id= 'code'><a style="font-size: 14px;">发票种类码:</a>
<input type="text" name="fpzlm" id="fpzlm" maxlength="25">
</td>
</tr>
<tr>
<td colspan="2" align="center" valign="middle">
<br />
<input type="button" name="yc" id="yc" value="预测" />
</td>
</tr>
</table>
<input type="hidden" name="requestType" id="requestType" value="testRequest"/>
<input type="hidden" name="type" id="type" value="fs"/>
<input type="hidden" name="hy" id="hy" value="0"/>
<input type="hidden" name="pz" id="pz" value="00382"/>
<!-- <input type="hidden" name="jd" id="jd" value=""/>-->
<input type="hidden" name="swjg" id= "swjg" value="2220102"/>
</form>
</center>
</div>
</td>
<td width="3" valign="top" background="/chinataxskskj/images/index_r2_c1.jpg"> </td>
</tr>
<tr>
<td height="17" background="/chinataxskskj/images/index_r3_c1.jpg" width="240" height="17"></td>
<td colspan="2" background="/chinataxskskj/images/index_r5_c4.jpg"><br>
</tr>
</table> <!-- 最外层的 表格 -->
<%@ include file="../common/banquan.jsp" %>
</body>
</html>
posted on 2013-11-26 21:54 fantiejun0436 阅读(351) 评论(0) 编辑 收藏 举报