js改变ID值
<script>
var object = new Object();
function t_onchange(obj){
var s = document.getElementById("s1").value;
var k = document.getElementById("s2").value;
if(typeof(object[s])=='undefined'){
object[s] = {};
}
if(typeof(object[s][k])=='undefined') object[s][k]=new Object();
object[s][k][obj.id]=obj.value;
}
function s_change(){
for(var i=1;i <57;i++){
document.getElementById(i).checked=false;
}
var s = document.getElementById("s1").value;
var k = document.getElementById("s2").value;
if(typeof(object[s])!='undefined'){
if(typeof(object[s][k])!='undefined'){
for(var i in object[s][k]){
document.getElementById(i).checked=object[s][k][i];
}
}
}
}
</script>
<table>
<tr>
<td>
第 <select name="week" id="s1" onChange="s_change()">
<%
for i=1 to 18
response.Write " <option value='"&i&"'>"&i
NEXT
%>
</select>周
</td>
<td>
第 <select name="zu" id="s2" onChange="s_change(this)">
<%
for i=1 to 10
response.Write " <option value='"&i&"'>"&i
NEXT
%>
</select>台
</td>
</tr>
<tr> <td> </td> </tr>
<tr>
<td colspan="3">
<table border="1" align="center" width="100%" bordercolor="#d5fcfc">
<tr> <td width="60px" > </td> <td width="50px" >星期一 </td> <td width="50px">星期二 </td> <td width="50px" >星期三 </td> <td width="50px" >星期四 </td> <td width="50px" >星期五 </td> <td width="50px" >星期六 </td> <td width="50px">星期日 </td> </tr>
<tr> <td width="60px">第1、2节 </td>
<% for a=1 to 7
response.Write" <td width='50px'> <input type='checkbox' name='"&a&"' id='1_1_b"&a&"' onClick='t_onchange(this)'> </td>"
next
%>
</tr>
<tr> <td width="60px">第3、4节 </td>
<% for b=8 to 14
response.Write" <td width='50px'> <input type='checkbox' name='"&b&"' id='1_1_b"&b&"' onClick='t_onchange(this)'> </td>"
next
%> </tr>
<tr> <td width="60px">第5、6节 </td>
<% for c=15 to 21
response.Write" <td width='50px'> <input type='checkbox' name='&qu