只有本站会员才能查看附件,请 登录
潜水多日学习,有一自认为难度挺大的问题向各位老师求教,这是个网页评分系统的页面,请问怎样才能同时让三个个判断语句集中于一个提交按钮上?
1. 比如当这个页面中出现相同的2分、1分、0分超过10个就要弹出一个消息框提示要写备注再提交才会成功.
2. 相同的1-5分,比如图中的2分超过22个以上的时候就不允许提交,弹出一个消息框要求重新填写才能提交成功。
写好的一个判断语句:
提交已经绑定了一个判断:同时给四个人评分,如果只给一个人评分会出现一个提示msgbox.

<!--#include file="inc/conn.asp"-->
<!--#include file="inc/check.asp"-->
<!--#include file="inc/function.asp"-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Admin_interface</title>
<link href="school-css.css" rel="stylesheet" type="text/css" />
<link href="css.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="jquery-1.3.2.js" type="text/javascript"></script>
<script src="WdatePicker.js"></script>
<script language="javascript">
$(document).ready(init);
function init ()
{
$('#aa1').blur(CheckId);
$('#bb1').blur(CheckId);
$('#cc1').blur(CheckId);
$('#dd1').blur(CheckId);
$('#fm_post select').change(Count);
}
var tempIdstr = "";
function CheckId()
{
var Staff_ID = $(this).val();
tempIdstr = $(this).attr("id").substring (0,2);
var l = "";
if (tempIdstr == "aa")
l = "lfaorfa"
else
l = "lfaorfa"
$.get('ajaxasp/check_Staff.asp',{Staff_ID:Staff_ID,l:l},function(data){
$("#"+tempIdstr+"2").html(data);
});
}
function Count()
{
var tempId = $(this).attr("id").substring (0,2);
var num = 0;
for(i=3;i<=12;i++)
{
//alert($("#"+tempId+i.toString()).val());
num += Number($("#"+tempId+i.toString()).val());
}
if($("#"+tempId+"2").html() !="" && $("#"+tempId+"2").html() !="Err")
{
$("#"+tempId+"13").html(num.toString());
$("#info").html("Please enter staff id at first and select points!");
}
else
{
$("#"+tempId+"13").html("0");
$("#info").html("Please input the correct number!");
}
}
function checksub()
{
var no = $("#no").val();
var cfa = $("#cfa").val();
var dt = $("#dt").val();
var cm = $("#cm").val();
var id = "";
var sc = "";
var n = 0;
var arr = Array ("aa","bb","cc","dd")
for(i = 0;i<arr.length;i++)
{
if($("#"+arr[i]+"2").html() !="" && $("#"+arr[i]+"2").html() !="Err")
{
n++;
if(id =="")
{
id = $("#"+arr[i]+"1").val();
sc= $("#"+arr[i]+"13").html();
}
else
{
id += ","+$("#"+arr[i]+"1").val();
sc += ","+$("#"+arr[i]+"13").html();
}
}
}
if(n <4)
{
if(confirm("Only Rating to "+n+" staffs, is it required to submit information?"))
{
$('#info').html("Data have to saving,please waiting....");
$.get('ajaxasp/cfa_save_score.asp',{no:no,cfa:cfa,dt:dt,id:id,sc:sc,cm:cm},function(data){
$('#info').html("Save to sucessful!");
// $('#info').html(data);
location.reload();
});
}
}
else
{
$('#info').html("Data have to saving,please waiting....");
$.get('ajaxasp/cfa_save_score.asp',{no:no,cfa:cfa,dt:dt,id:id,sc:sc,cm:cm},function(data){
$('#info').html("Save to sucessful!");
location.reload();
});
}
}
</script>