function check(){
if (rfid.epc.value ==""){
alert("名称不能为空!");
return false;
}
return true;
}
原来有一个,判断内容不能为空;
现在要改为epc中输入的内容,必须是28位的16进制数值,本人对javascript函数不太熟,请熟悉的朋友帮忙一下,谢谢!
------解决方案--------------------
- JScript code
function check() { if (/^-?[0-9A-Fa-f]{28}$/.test(rfid.epc.value)) return true; alert("输入格式不正确!"); return false;}
------解决方案--------------------
function check() {
if (/^-?[0-9A-Fa-f]{28}$/.test(rfid.epc.value)) return true;
alert("输入格式不正确!");
return false;
}