📄 check.js
字号:
var cannotSubmit = true;
var showmessage = false;
function userSave(){
if(checkEmpty("empcode","工号不能为空!"))return;
if(cannotSubmit){
if(!showmessage){
alert('请检测工号!');
}else{
alert('该工号已经存在!');
}
$('empcode').focus();
return ;
}
if(checkEmpty("empname","姓名不能为空!"))return;
if(checkEmpty('degreeid','请选择学历!'))return;
if(checkEmpty('jobid','请选择职位!'))return;
if(checkEmpty('deptid','请选择部门!'))return;
if(checkEmpty('workid','请选择工作地点!'))return;
if(confirm('确认要保存该信息吗?')){
postForm("empinfoform");
}
}
function keycodecheck(){
getObject('mes').innerHTML='<span disabled>未检测</span>';
cannotSubmit = true;
showmessage = false
}
function checkDel(){
if(checkUnSelected("selected", "请选择要删除的项!"))return;
if(confirm("确定要删除吗?"))
link("userAction.do?method=userDelete");
}
function checkUsercode(){
if(checkEmpty("empcode","工号不能为空!"))return;
var empcode = $F('empcode');
var url = "userAction.do?method=usercodecheck";
var para = "empcode="+empcode;
MyAjax(url,para,'post',showResponse);
}
function showResponse(thisobj){
if(thisobj.responseText=='1'){
alert('允许注册!');
cannotSubmit = false;
getObject('mes').innerHTML='<span>已通过检测</span>';
}else if(thisobj.responseText=='0'){
alert('该工号已经存在!');
$('empcode').focus();
showmessage = true;
cannotSubmit = true;
getObject('mes').innerHTML="<font color='red'>工号已经存在</font>";
}else{
alert('与服务器失去连接!');
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -