📄 human.js
字号:
//验证添加档案时数据有效性function validityCheck() { var flag8 = orientation("humanIdCard", "div8"); var flag7 = orientation("humanName", "div7"); var flag6 = orientation("humanProDesignation", "div6"); var flag5 = orientation("humanMajorId", "div5"); var flag4 = orientation("humanMajorKindId", "div4"); var flag3 = orientation("thirdKindId", "div3"); var flag2 = orientation("secondKindId", "div2"); var flag1 = orientation("firstKindId", "div1"); if (!flag1 || !flag2 || !flag3 || !flag4 || !flag5 || !flag6 || !flag7 || !flag8) { alert("\u5e26*\u9009\u9879\u5fc5\u987b\u8f93\u5165..."); return; } var idCard = document.getElementById("humanIdCard"); var rs = idCard.value.match(/^(\d{6})()?(\d{2})(\d{2})(\d{2})(\d{3})$/); var rs1 = idCard.value.match(/^(\d{6})()?(\d{4})(\d{2})(\d{2})(\d{3})(\w)$/); if (rs != null || rs1 != null) { document.getElementById("div8").innerHTML = "* "; } else { document.getElementById("div8").innerHTML = "<font color=\"red\">* </font>"; return; } document.forms[0].submit();}
//验证文本框或下拉列表框是否输入内容function orientation(id, divId) { var obj = document.getElementById(id); if (obj.value == "NULL" || obj.value.replace(/\s*/, "") == "") { document.getElementById(divId).innerHTML = "<font color=\"red\">* </font>"; obj.focus(); return false; } else { document.getElementById(divId).innerHTML = "* "; return true; }}//失去输入焦点后,验证文本框是否已经输入,如果输入内容就去掉红色提示function hideRed(obj) { if (obj.value.replace(/\s*/, "") != "") { obj.parentNode.previousSibling.childNodes[1].innerHTML = "* "; } else { obj.parentNode.previousSibling.childNodes[1].innerHTML = "<font color=\"red\">* </font>"; }}//失去输入焦点后,验证下位列表框是否已经输入,如果输入内容就去掉红色提示,如果有hiddenId就为隐藏域赋值function hideRedSelect(obj, hiddenId) { if (obj.value != "NULL") { obj.parentNode.previousSibling.childNodes[1].innerHTML = "* "; if (hiddenId != null) { var index = obj.selectedIndex; //alert(obj.options[index].text); document.getElementById(hiddenId).value = obj.options[index].text; } } else { obj.parentNode.previousSibling.childNodes[1].innerHTML = "<font color=\"red\">* </font>"; }}//复核时验证页面输入function auditCheck() { var humanName = document.getElementById("humanName").value; if (humanName.replace(/\s*/, "") == "") { alert("\u5e26*\u9009\u9879\u5fc5\u987b\u8f93\u5165..."); document.getElementById("humanName").parentNode.previousSibling.childNodes[1].innerHTML = "<font color=\"red\">* </font>"; return; } else { document.getElementById("humanName").parentNode.previousSibling.childNodes[1].innerHTML = "* "; } var idCard = document.getElementById("humanIdCard"); var rs = idCard.value.match(/^(\d{6})()?(\d{2})(\d{2})(\d{2})(\d{3})$/); var rs1 = idCard.value.match(/^(\d{6})()?(\d{4})(\d{2})(\d{2})(\d{3})(\w)$/); if (rs != null || rs1 != null) { idCard.parentNode.previousSibling.childNodes[1].innerHTML = "* "; } else { idCard.parentNode.previousSibling.childNodes[1].innerHTML = "<font color=\"red\">* </font>"; return; } document.forms[0].submit();}//删除档案function del(id) { var flag = confirm("\u60a8\u786e\u5b9a\u771f\u7684\u8981\u5220\u9664\u5417"); if (flag) { location.href = "human.do?method=doDeleteHumanFile&id=" + id; }}//光棒效果********************************************************** var bg;function show(obj) { bg = obj.style.backgroundColor; obj.style.backgroundColor = "lightblue";}function revert(obj) { obj.style.backgroundColor = bg;}//END************************************************************** //查看档案详细信息**************************************************** function queryDetail(id) { location.href = "human.do?method=doQueryDetail&id=" + id;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -