?? materialtype.js
字號:
function checkValue() {
var materialTypeNo = document.form1.materialTypeNo.value;
var materialTypeName = document.form1.materialTypeName.value;
var maUnit = document.form1.maUnit.value;
var inMin = document.form1.inMin.value;
var inMax = document.form1.inMax.value;
var reMark = document.form1.reMark.value;
if (materialTypeNo=="") {
window.alert("請輸入物品類型號");
document.form1.materialTypeNo.focus();
return false;
}
if(materialTypeNo!=""){
var regp =/^[0-9a-zA-Z]{1,30}$/; //只輸入數字和字母的正則
if (materialTypeNo.match(regp) == null)
{
document.form1.materialTypeNo.focus();
alert("輸入物品類型號格式錯誤!必須是字母和數字組成!");
return false;
}
}
if (materialTypeName=="") {
window.alert("請輸入物品類型名稱");
document.form1.materialTypeName.focus();
return false;
}
if (materialTypeName.length > 50){
window.alert("輸入物品名稱長度超出,限定為25個中文字符或者50個英文字符。");
document.form1.materialTypeName.focus();
return false;
}
var materialPaTypeNo = document.form1.materialPaTypeNo.value;
if (materialPaTypeNo.length > 20){
window.alert("輸入物品父類型號長度超出,限定為10個中文字符或者20個英文字符。");
document.form1.materialPaTypeNo.focus();
return false;
}
if (maUnit.length > 50){
window.alert("輸入物品類型單位長度超出,限定為25個中文字符或者50個英文字符。");
document.form1.maUnit.focus();
return false;
}
// if (inMin=="") {
// window.alert("請輸入庫存底限");
// document.form1.inMin.focus();
// return false;
// }
if (inMin!=""){
var regp =/^\d{1,9}$/;
if (inMin.match(regp) == null)
{
document.form1.inMin.focus();
alert("輸入庫存底限格式錯誤!");
return false;
}
}
// if (inMax=="") {
// window.alert("請輸入庫存上限");
// document.form1.inMax.focus();
// return false;
// }
if (inMax!=""){
var regp =/^\d{1,9}$/;
if (inMax.match(regp) == null)
{
document.form1.inMax.focus();
alert("輸入庫存上限格式錯誤!");
return false;
}
}
if(inMax!=""&&inMin!=""){
if(inMin>inMax)
{
window.alert("上限必須大于下限!");
document.form1.inMin.focus();
return false;
}}
if (reMark.length > 100){
window.alert("輸入備注長度超出,限定為50個中文字符或者100個英文字符。");
document.form1.reMark.focus();
return false;
}
return true;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -