*/
function Isip (data) {
var regip=/^ (1?d?d| ( 2 ([0-4]d|5[0-5])).) {3} (1?d?d| (2 ([0-4]d|5[0-5])) $/;
return regip.test (data);
}
function IsMobile (MNO) {
var regmobile=/^0?1 (3|5|8) d{9}$/;
Return Regmobile.test (MNO);
}
function Isemail (stremail) {
if (/^w+ (-w+) | (stremail.search) | (. w+)) *@[a-za-z0-9]+ ((. | -) [a-za-z0-9]+] *. [a-za-z0-9]+$/)!=-1)
return true;
Else
return false;
}
function Isdomain (strdomain) {
var domainreg=/^ ([w-]+) | ( [u4e00-u9fa5]+)] (.) (([w-]+) | ([w-]+) ([.]?) ([w-]+) | ([u4e00-u9fa5]+)] [w.-]*$/;
Return Domainreg.test (Strdomain);
}
function Ischinese (text) {
Whether to contain Chinese
var dhinesereg=/^.*[u4e00-u9fa5]+.*$/;
return dhinesereg.test (text);
}
function Isen (text) {
for (i=0;i<text.length;i++)
if (Text.charcodeat (i) >255) {
Alert ("Sorry! Submission failed," +text+ "cannot contain Chinese characters!");
Data.focus ();
Data.select ();
return false;
}
return true;
}
function Isnum (number) {
var i,str1= "0123456789";
if (number==null| | number== "") return false;
for (i=0;i<number.length;i++) {
if (Str1.indexof (Number.charat (i)) ==-1) {
return false;
Break
}
}
return true;
}
function IsNull (text) {
if (text== "") {
Alert ("Sorry! Commit failed," +text+ "cannot be empty!");
Data.focus ();
return false;
}
else{
return true;}
}
function Hasgb (text) {
for (i=0;i<text.length;i++)
if (Text.charcodeat (i) >255) return true;
Alert ("Sorry! Submission failed," +text+ "must contain Chinese characters!");
Data.focus ();
Data.select ();
return false;
}
function Validchar (text) {
Charlist= "&^%$#@!* () ~ ' +";
for (i=0;i<charlist.length;i++)
if (Text.indexof (Charlist.charat (i))!=-1) {
Alert ("Error," +text+ "cannot contain special symbols [" +charlist.charat (i) + "]!");
Data.focus ();
Data.select ();
return false;
}
return true;
}