?? admin_addclass.js
字號:
function saveClass(){
with(addclassForm){
if(menu_cn.value==""){
alert("菜單名不能為空!");
menu_cn.focus();
return false;
}
else if(menu_en.value==""){
alert("英文名不能為空!");
menu_en.focus();
return false;
}
else if(index.value==""){
alert("排序不能為空!");
index.focus();
return false;
}
if(checkEnmenu() && checkIndexNum()){
submit();
}
}
}
function checkMenuName(menuname) {
var url = "checkMenuName.asp?menu_en=" + escape(menuname);
xmlHttp.open("GET", url, true);
xmlHttp.onreadystatechange = showResult;
xmlHttp.send(null);
}
function alterCheckMenuName(menuname,menuID) {
var url = "checkMenuName.asp?menu_en=" + escape(menuname) + "&id=" + escape(menuID);
xmlHttp.open("GET", url, true);
xmlHttp.onreadystatechange = showResult;
xmlHttp.send(null);
}
function showResult() {
if (xmlHttp.readyState == 4) {
var response = xmlHttp.responseText;
if(response == "1"){
alert("此英文名菜單已經存在!");
document.getElementById("showCheckResult").innerHTML="";
document.getElementById("menu_en").focus();
return false;
}
else{
document.getElementById("showCheckResult").innerHTML="<a href='javascript:void(0);'>此名可用</a>";
}
}
}
function checkIndexNum(){
with(addclassForm){
var re=/\D/;
testStr=index.value;
if(re.test(testStr)==true){
alert("排序只能是數字序號!");
index.focus();
return false;
}
}
return true;
}
function checkEnmenu(){
with(addclassForm){
var re=/\W/;
testStr=menu_en.value;
if(re.test(testStr)==true){
alert("菜單英文名只能由字母、數字和下劃線組成!");
menu_en.focus();
return false;
}
}
return true;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -