日期:2014-05-16 浏览次数:21052 次
<SCRIPT LANGUAGE="JavaScript">
function checksubmit()
{
for(var i = 0; i < document.form.pcdept.length; i++){
if(document.form.lznl_score[k].value.length==0 ){
alert("请给所有部门评完分数后再进行提交!");
document.form.lznl_score[k].focus();return false;
}
else if(document.form.lznl_score[k].value<0 or document.form.lznl_score[k].value>15){
alert("请给分数后再进行提交!");
document.form.lznl_score[[k].focus();return false;
}
}
return true;
}
</SCRIPT>
<!--这是定义的表单及从一个SQL语句中取出每一个部门再对他们分别评分:-->
<form name=form method='post' action='/monthsco/sort2_result2.asp' onsubmit='return checksubmit();' >
<%
sqls="select deptid,deptname from deptcp where deptid not in (select deptid from score_cp where dt='"&t&"' and scorer='"&user_id&"')"
set rss=conn2.execute(sqls)
do while not rss.eof
%>
<tr bgcolor='#ffd5d4' align='center'>
<td ><%=rss("deptname")%><input type='hidden' name='pcdept' value='<%=rss("deptid")%>'></input></td>
<td ><input type='text' name='lznl_score' class='1' onkeydown='if(event.keyCode==13)event.keyCode=9' onkeydown='if(event.keyCode==13)event.keyCode=9' onfocus='this.select()''></input></td>
<td ><input type='text' name='zxnl_score' class='1' onkeydown='if(event.keyCode==13)event.keyCode=9' onkeydown='if(event.keyCode==13)event.keyCode=9' onfocus='this.select()''></input></td>
<td ><input type='text' name='fwnl_score' class='1' onkeydown='if(event.keyCode==13)event.keyCode=9' onkeydown='if(event.keyCode==13)event.keyCode=9' onfocus='this.select()''></input></td>
<td><input type='text' name='cxnl_score' class='1' onkeydown='if(event.keyCode==13)event.keyCode=9' onkeydown='if(event.keyCode==13)event.keyCode=9' onfocus='this.select()''></input></td>
<td><input type='text' name='ljzl_score' class='1' onkeydown='if(event.keyCode==13)event.keyCode=9' onkeydown='if(event.keyCode==13)event.keyCode=9' onfocus='this.select()''></input></td>
<td><input type='hidden' name='pcdeptn' value='<%=rss("deptname")%>'></input></td>
</tr>
<%
rss.movenext
loop
rss.close
%>
<!--然后这个就是在sort2_result2.asp页面中的处理部门,先for循环把每一个数值弄出来-->
for k=1 to request.form("pcdept").count
pcdeptid=trim(request.form("pcdept")(k))
deptn=trim(request.form("pcdeptn")(k))
lznl_score=trim(request.form("lznl_score")(k))
zxnl_score=trim(request.form("zxnl_score")(k))
fwnl_score=trim(request.form("fwnl_score")(k))
ljzl_score=trim(request.form("ljzl_score")(k))
cxnl_score=trim(request.form("cxnl_score")(k))
<!