String.prototype.trim = function()
{
return this.replace(/(^\s*)|(\s*$)/g,"");
}
String.prototype.len= function()
{
return this.replace(/[^\x00-\xff]/g,"**").length;
}
function f_check_zh(obj){
if (/^[\u4e00-\u9fa5]+$/.test(obj.value)) {
return true;
}
return false;
}
function checkFormat(){
fobj=document.ticketform;
if(fobj.tnb.value==""){
window.alert("不能为空!");
fobj.tnb.focus();
return false;
}
if(fobj.tnb.value.len() != 13 ){
window.alert("长度不等于13!");
fobj.tnb.focus();
return false;
}
}
阅读(1054) | 评论(0) | 转发(0) |