function IsNum(num){
var reNum=/^\d*$/;
return(reNum.test(num));
}
var str=document.getElementById("name").value;
var reg = /^[\u4e00-\u9fa5]+$/i; //判断是否为汉字
if (!reg.test(str))
{
alert("请输入中文名字!");
document.form1.name.focus();
return false;
}
return true;
//判断是否为时间
function isDate(dateStr)
{
var datePat = /^(\d{4})(\-)(\d{1,2})(\-)(\d{1,2})$/;
var matchArray = dateStr.match(datePat);
if (matchArray == null) return false;
var month = matchArray[3];
var day = matchArray[5];
var year = matchArray[1];
if (month < 1 || month > 12) return false;
if (day < 1 || day > 31) return false;
if ((month==4 || month==6 || month==9 || month==11) && day==31) return false;
if (month == 2)
{
var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
if (day > 29 || (day==29 && !isleap)) return false;
}
return true;
}