复制代码 代码如下: function CheckForm2() { //mac地址正则表达式 var reg_name=/[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}/; if(!reg_name.test(document.form2.mac.value)){ alert("mac地址格式不正确!
function CheckForm2()
{
//mac地址正则表达式
var reg_name=/[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}/;
if(!reg_name.test(document.form2.mac.value)){
alert("mac地址格式不正确!mac地址格式为00:24:21:19:BD:E4");
document.form2.mac.focus();
return false;
}
return true;
}