//函数名:chkemail
//功能介绍:检查是否为email address
//参数说明:要检查的字符串
//返回值:0:不是 1:是
function chkemail(a)
{ var i=a.length;
var temp = a.indexof(@);
var tempd = a.indexof(.);
if (temp > 1) {
if ((i-temp) > 3){
if ((i-tempd)>0){
return 1;
}
}
}
return 0;
}
//函数名:fucchecknum
//功能介绍:检查是否为数字
//参数说明:要检查的数字
//返回值:1为是数字,0为不是数字
function fucchecknum(num)
{
var i,j,strtemp;
strtemp="0123456789";
if ( num.length== 0)
return 0
for (i=0;i<num.length;i++)
{
j=strtemp.indexof(num.charat(i));
if (j==-1)
{
//说明有字符不是数字
return 0;
}
}
//说明是数字
return 1;
}
//函数名:fucchecktel
//功能介绍:检查是否为电话号码
//参数说明:要检查的字符串
//返回值:1为是合法,0为不合法
function fucchecktel(tel)
{
var i,j,strtemp;
strtemp="0123456789-()# ";
for (i=0;i<tel.length;i++)
{
j=strtemp.indexof(tel.charat(i));
if (j==-1)
{
//说明有字符不合法
return 0;
}
}
//说明合法
return 1;
}
