根据select选择的不同来显示不同的内容以及年份的显示,求指出错误的地方
先贴自己的代码:
AJax部分代码:
//年份select
var LastYear;
function selYear()
{
var len=16;//select长度
var selObj=documet.getElementById(obj);
var selIndex=parseInt(len/2)-1;
var newOpt;
var LY=Cyear-LastYear;
for ( var i = 0; i < len; i++) {
if (selObj.options.length!=len) {
newOpt=documet.createElement("OPTION");
newOpt.text=Cyear-selIndex+i;
newOpt.value=Cyear-selIndex+i;
selObj.options.add(newObj,i);
if (selIndex==i) {LastYear=newOpt.value;}
}else
{
selObj.options[i].text=parseInt(selObj.options[i].text)+LY;
selObj.options[i].value=parseInt(selObj.options[i].value)+LY;
if (selIndex==i) {LastYear=newOpt.value;}
}
}
selObj.selectedIndex=selIndex;
}
//select列表内容显示
function tableSelect(v)
{
for ( var i = 1; i <= 4; i++) {
document.getElementById("select_"+i).style.display="none";
}
if (v != 0) {
document.getElementById("select_"+v).style.display=" ";
}
}
tableSelect(0);
jsp页面代码:
<form name="queryForm" method="post" action="search.jsp">
<div id="login-box">
<div class="login-power">
<div class="login-submit"><button type="buttom" name="sm1" class="login-btn" onclick="checks()"></button></div>
</div>
<div class="login-main">
<dl>
<dt>查询类别:</dt>
<dd>
<select name="kslx" id="kslx" onchange="tableSelect(this.value)">
<option value="1">XXXXX</option>
<option value="2">XXXXX</option>
<option value="3">XXXXX</option>
<option value="4">XXXXX</option>
</select>
</dd>
<span id="select_1">
<dt>姓 名:</dt>
<dd><input type="text" name="name" id="name" value="" maxlength="20"/></dd>
<dt>身份、准考:</dt>
<dd><input type="text" name="sfzh_zkzh" id="sfzh_zkzh" value="" maxlength="20"/></dd>
<dt>年 度:</dt>
<dd><select size="1" id="yearSelect" name="yearSelect" onchange="selYear('yearSelect',this.value)"></select></dd>
<script>selYear('yearSelect',2014)//初始化select</script>
<dt>上、下半年:</dt>
<dd><select name="sxbn" id="sxbn">
<option value="1">上半年</option>
<option value="1">下半年</option>
</select></dd>
<dd>
<input id="vdcode" type="text" name="vdcode" style="text-transform:uppercase;" value="" maxlength="4"/>
<img id="SecurityCode" src="/SecurityCode?op=noChange" width="60" height="20" style="border:0;" onclick="changeSecurityCode()" style