function chk_data(cmdAction){
var msg = "";
Code = document.getElementById('IP').value;
var reg = /^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])\.){3}([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])((-([1-9]\d?|1\d\d|2[0-4]\d|25[0-5]))?|(\/([12]?\d|3[0-2]))?)$/;
if(!reg.test(Code)){
msg = msg + 'IP錯誤!\n\n';
}
if ( msg != "" ){
alert(msg);
return false;
}
}
沒有留言:
張貼留言