JS verification function call methods and notes:
1. Set onsubmit="return test()" for the form and submit it in conjunction with <input type="submit" name="Submit" value="check">.
2.<input type=text onkeydown="test();"> //When the mouse is pressed, call the function directly to verify
3. <input type=text onblur="testl()"> //Pause your own value for verification, test(this)//Pause the object itself for verification
4.<input type="button" value="test" onclick="test()"> //Click Btn to verify, if it passes, use [0].submit(); to submit the form
5.<input onClick="return test();" type="submit" name="submit" value=" Submit information ">//Use submit for submission verification. If return false in test; return true will not be submitted.
6.<script type="javascript">....function test(){...return false;...}...</script>
7.||with,&&or,!Non
8. Common events: onblur loses focus, onchange loses focus and content changes, onfocus element gets focus, onreset triggers this event when the RESET attribute in the form is fired, onsubmit form is submitted
9. Verify the regular expression: if(/^[1-9]\d*$/.test(str)) returns true and pass, FALSE pass does not pass
("ip").value//Access ID value, document.form1.//Accessed via name
11.<input onblur="if((/^ +| +$/g,'')=='')alert('can't be empty!')"> //Execute a single regular verification example
Verification function:
<input type="text" name="text1" onblur="test();" value="" />
1. Character length limit
function test()
{
if(document.form1.>50)
{
alert("can't exceed 50 characters!");
document.form1.();
return false;
}
}
2. Only in English, letters or numbers
function test()
{
if(!(>=65&&<=90))
{
alert("can only be in English!");
document.form1.();
}
}
<input onblur="if(/[^0-9a-zA-Z]/())alert('Wrong')"> //Letter or number
3. It can only be a number
function test()
{
if(!((>=48&&<=57)||(>=96&&<=105))) //Consider the numeric keys on the keyboard
{
alert("can only be a number!");
document.form1.();
}
}
or
function test(NUM)
{
var i,j,strTemp;
strTemp="0123456789";
if ( == 0)
return 0
for (i=0;i<;i++)
{
j=((i));
if (j==-1)
{
alert("can only be a number!");
return false;
}
}
//The description is a number
return true;
}
5. Verify the mailbox (regular, function)
function isEmail(strEmail) {
if ((/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
return true;
else
alert("Error format!");
}
function isEmail() {
if ((0)=="." ||
(0)=="@"||
('@', 0) == -1 ||
('.', 0) == -1 ||
("@")==-1 ||
(".")==-1)
{
alert("Email address format is incorrect!");
();
return false;
}
}
<input type="text" onblur="isEmail();" name="text1" />
6. Block keywords (block *** and **** here)
function test() {
if((document.form1. ("***") == 0)||(document.form1. ("****") == 0)){
alert("Keyword exists");
document.form1.();
return false;
}
}
7. Compare whether the inputs are the same for the two times
if( != .) {
();
= '';
. = '';
alert("The password entered twice is different, please re-enter!");
return false;
}
8. Determine whether it is composed of empty or space
function test(){
if(checkspace(document.form1.)) {
document.form1.();
alert("Empty or contains space!");
return false;
}
}
function checkspace(checkstr) {
var str = '';
for(i = 0; i < ; i++) {
str = str + ' ';
}
return (str == checkstr);
}
or:
<input onblur="if((/^ +| +$/g,'')=='')alert('can't be empty!')"> //Execute a single regular verification example
9. Verify whether it is a digital phone, it can only be a digital and -
Regular:\d{3}-\d{8}|\d{4}-\d{7}
function istel(elem) {
var str=;
var oneDecimal=false;
var oneChar=0;
str=( );
for (var i=0; i<; i++) {
oneChar=(i).charCodeAt(0);
if(oneChar==45){ continue; }
if(oneChar<48 || oneChar > 57) {
alert("This item can only enter numbers and '-' numbers.");
return false;
}
}
return true;
}
or
function fucCheckTEL(TEL)
{
var i,j,strTemp;
strTemp="0123456789-()# ";
for (i=0;i<;i++)
{
j=((i));
if (j==-1)
{
alert("This item can only enter numbers and '-' numbers.");
return false;
}
}
//Explanation legal
return true;
}
or
//Calculate the normal telephone and fax numbers: it can start with "+", except for the number, it can contain "-"
function isTel(s)
{
//var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?(\d){1,12})+$/;
var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;
if (!(s)) return false
return true
}
or
Require:
(1) Phone number consists of numbers, "(", ")" and "-"
(2) Phone numbers are 3 to 8 digits
(3) If the phone number contains an area code, then the area code is three or four digits
(4) Area codes are separated from other parts by "(", ")" or "-"
(5) The mobile phone number is 11 or 12 digits. If it is 12 digits, then the first digit is 0
(6) The first and second digits of the 11-digit mobile phone number are "13"
(7) The second and third digits of the 12-digit mobile phone number are "13"
According to these rules, the following regular expressions can be drawn:
(^[0-9]{3,4}\-[0-9]{3,8}$)|(^[0-9]{3,8}$)|(^\([0-9]{3,4}\)[0-9]{3,8}$)|(^0{0,1}13[0-9]{9}$)
function PhoneCheck(s) {
var str=s;
var reg=/(^[0-9]{3,4}\-[0-9]{3,8}$)|(^[0-9]{3,8}$)|(^\([0-9]{3,4}\)[0-9]{3,8}$)|(^0{0,1}13[0-9]{9}$)/
alert((str));
}
<input type="text" name="text1" onblur="istel(this);" />
10.//Check whether num is a negative number when opt2 is 1 //Check whether num is a decimal number when opt1 is 1 // Returning 1 is correct, 0 is wrong
function chknbr(num,opt1,opt2)
{
var i=;
var staus;
// Staus is used to record the number of .
status=0;
if ((opt2!=1) && ((0)=='-'))
{
alert("You have enter a invalid number.");
return 0;
}
//An error occurred when the last bit is.
if ((i-1)=='.')
{
alert("You have enter a invalid number.");
return 0;
}
for (j=0;j<i;j++)
{
if ((j)=='.')
{
status++;
}
if (status>1)
{
alert("You have enter a invalid number.");
return 0;
}
if ((j)<'0' || (j)>'9' )
{
if (((opt1==0) || ((j)!='.')) && (j!=0))
{
alert("You have enter a invalid number.");
return 0;
}
}
}
return 1;
}
11. Check whether a string consists of numbers or letters
function test(str)
{
var strSource ="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
var ch;
var i;
var temp;
for (i=0;i<=(-1);i++)
{
ch = (i);
temp = (ch);
if (temp==-1)
{
alert("Incorrect format!");
return false;
}
}
if ((ch)==-1)
{
alert("Incorrect format!");
return false;
}
else
{
return true;
}
}
12. Digital Verification
Positive integer verification^[1-9]\d*$, Negative integer verification^-[1-9]\d*$, integer^-?[1-9]\d*$, non-negative integer^[1-9]\d*|0$, non-positive positive number^-[1-9]\d*|0$, floating point number^-?([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0)$
function test(str){
if(/^[1-9]\d*$/.test(str))
{
alert("Format cannot!");
return false;
}
else
{
return true;
}
}
13. Identity card
Regular:\d{15}|\d{18}
address
Regular:\d+\.\d+\.\d+\.\d+
15. Postal Code
Regular:[1-9]\d{5}(?!\d)
function isPostalCode(s)
{
//var patrn=/^[a-zA-Z0-9]{3,12}$/;
var patrn=/^[a-zA-Z0-9 ]{3,12}$/;
if (!(s)) return false
return true
}
Number
Regular:[1-9][0-9]{4,}
mark
Regular:\d{3}-\d{8}|\d{4}-\d{7}
18. Whether the color value is valid
function IsColor(color){
var temp=color;
if (temp=="") return true;
if (!=7) return false;
return ((/\\#[a-fA-F0-9]{6}/) != -1);
}
19. Is it valid?
function IsURL(url){
var sTemp;
var b=true;
sTemp=(0,7);
sTemp=();
if ((sTemp!="HTTP://")||(<10)){
b=false;
}
return b;
}
20. Is the mobile phone number valid?
function IsMobile(_str){
var tmp_str = trim(_str);
var pattern = /13\\d{9}/;
return (tmp_str);
}
or
//Calculate the mobile phone number: It must start with a number, except for the number, it can contain "-"
function IsMobile(s)
{
var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;
if (!(s)) return false
return true
}
Address and ID number verification (regular)
function checkIP()
{
obj=("ip").value
//IP address
//var exp=/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;
//ID card
//var exp=/\b(((?!\d\d\d)\d+|1\d\d|2[0-4]\d|25[0-5])(\b|\.)){4}/
//var exp=/^(\d{15}|\d{17}[x0-9])/
//var exp=/^([\d]{15}|[\d]{18}|[\d]{17}[x|X])$/
var reg = (exp);
if(reg==null)
{
alert("IP address is illegal!");
}
else
{
alert("The IP address is legal!");
}
}
22. Verify the login name: Only enter 5-20 strings that start with letters and can have numbers, "_", "."
function isRegisterUserName(s)
{
var patrn=/^[a-zA-Z]{1}([a-zA-Z0-9]|[._]){4,19}$/;
if (!(s)) return false
return true
}
23. Verify user name: Only 1-30 strings starting with letters can be entered
function isTrueName(s)
{
var patrn=/^[a-zA-Z]{1,30}$/;
if (!(s)) return false
return true
}
24. Verify password: Only 6-20 letters, numbers, and underscores can be entered
function isPasswd(s)
{
var patrn=/^(\w){6,20}$/;
if (!(s)) return false
return true
}
25. Date and time category
Short time, like (13:04:06)
function isTime(str)
{
var a = (/^(\d{1,2})(:)?(\d{1,2})\2(\d{1,2})$/);
if (a == null) {alert('The input parameter is not the time format'); return false;}
if (a[1]>24 || a[3]>60 || a[4]>60)
{
alert("Time format is incorrect");
return false
}
return true;
}
Short date, like (2003-12-05)
function strDateTime(str)
{
var r = (/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/);
if(r==null)return false;
var d= new Date(r[1], r[3]-1, r[4]);
return (()==r[1]&&(()+1)==r[3]&&()==r[4]);
}
For a long time, it looks like (2003-12-05 13:04:06)
function strDateTime(str)
{
var reg = /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/;
var r = (reg);
if(r==null)return false;
var d= new Date(r[1], r[3]-1,r[4],r[5],r[6],r[7]);
return (()==r[1]&&(()+1)==r[3]&&()==r[4]&&()==r[5]&&()==r[6]&&()==r[7]);
}
26. Judgment characters are all composed of letters of a-Z or A-Z
<input onblur="if(/[^a-zA-Z]/())alert('Wrong')">
27. Judgment characters consist of letters and numbers, underscores, and dots. The only thing that starts is underscores and letters.
<input onblur="if(/^([a-zA-z_]{1})([\w]*)$/())alert('Wrong')">
28. The value of the form cannot be empty, cannot exceed imax characters, cannot be less than imix characters, and the input is Chinese judgment
function isNull(elem){
//var pattern=/^\s+|\s+$/;
if((/(^\s+|\s$)/g, "")==""){
return false;
}else{
return true;
}
}
function imax(elem){
if(>imax){
return false;
}else{
return true;
}
}
function imix(elem){
if( false;
}else{
return true;
}
}
function isChinese(elem){
var pattern=/[^\x00-\xff]/g;
if((elem)){
//Includes Chinese
return false;
}else{
//Not included in Chinese
return true;
}
}
1. Set onsubmit="return test()" for the form and submit it in conjunction with <input type="submit" name="Submit" value="check">.
2.<input type=text onkeydown="test();"> //When the mouse is pressed, call the function directly to verify
3. <input type=text onblur="testl()"> //Pause your own value for verification, test(this)//Pause the object itself for verification
4.<input type="button" value="test" onclick="test()"> //Click Btn to verify, if it passes, use [0].submit(); to submit the form
5.<input onClick="return test();" type="submit" name="submit" value=" Submit information ">//Use submit for submission verification. If return false in test; return true will not be submitted.
6.<script type="javascript">....function test(){...return false;...}...</script>
7.||with,&&or,!Non
8. Common events: onblur loses focus, onchange loses focus and content changes, onfocus element gets focus, onreset triggers this event when the RESET attribute in the form is fired, onsubmit form is submitted
9. Verify the regular expression: if(/^[1-9]\d*$/.test(str)) returns true and pass, FALSE pass does not pass
("ip").value//Access ID value, document.form1.//Accessed via name
11.<input onblur="if((/^ +| +$/g,'')=='')alert('can't be empty!')"> //Execute a single regular verification example
Verification function:
<input type="text" name="text1" onblur="test();" value="" />
1. Character length limit
function test()
{
if(document.form1.>50)
{
alert("can't exceed 50 characters!");
document.form1.();
return false;
}
}
2. Only in English, letters or numbers
function test()
{
if(!(>=65&&<=90))
{
alert("can only be in English!");
document.form1.();
}
}
<input onblur="if(/[^0-9a-zA-Z]/())alert('Wrong')"> //Letter or number
3. It can only be a number
function test()
{
if(!((>=48&&<=57)||(>=96&&<=105))) //Consider the numeric keys on the keyboard
{
alert("can only be a number!");
document.form1.();
}
}
or
function test(NUM)
{
var i,j,strTemp;
strTemp="0123456789";
if ( == 0)
return 0
for (i=0;i<;i++)
{
j=((i));
if (j==-1)
{
alert("can only be a number!");
return false;
}
}
//The description is a number
return true;
}
5. Verify the mailbox (regular, function)
function isEmail(strEmail) {
if ((/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
return true;
else
alert("Error format!");
}
function isEmail() {
if ((0)=="." ||
(0)=="@"||
('@', 0) == -1 ||
('.', 0) == -1 ||
("@")==-1 ||
(".")==-1)
{
alert("Email address format is incorrect!");
();
return false;
}
}
<input type="text" onblur="isEmail();" name="text1" />
6. Block keywords (block *** and **** here)
function test() {
if((document.form1. ("***") == 0)||(document.form1. ("****") == 0)){
alert("Keyword exists");
document.form1.();
return false;
}
}
7. Compare whether the inputs are the same for the two times
if( != .) {
();
= '';
. = '';
alert("The password entered twice is different, please re-enter!");
return false;
}
8. Determine whether it is composed of empty or space
function test(){
if(checkspace(document.form1.)) {
document.form1.();
alert("Empty or contains space!");
return false;
}
}
function checkspace(checkstr) {
var str = '';
for(i = 0; i < ; i++) {
str = str + ' ';
}
return (str == checkstr);
}
or:
<input onblur="if((/^ +| +$/g,'')=='')alert('can't be empty!')"> //Execute a single regular verification example
9. Verify whether it is a digital phone, it can only be a digital and -
Regular:\d{3}-\d{8}|\d{4}-\d{7}
function istel(elem) {
var str=;
var oneDecimal=false;
var oneChar=0;
str=( );
for (var i=0; i<; i++) {
oneChar=(i).charCodeAt(0);
if(oneChar==45){ continue; }
if(oneChar<48 || oneChar > 57) {
alert("This item can only enter numbers and '-' numbers.");
return false;
}
}
return true;
}
or
function fucCheckTEL(TEL)
{
var i,j,strTemp;
strTemp="0123456789-()# ";
for (i=0;i<;i++)
{
j=((i));
if (j==-1)
{
alert("This item can only enter numbers and '-' numbers.");
return false;
}
}
//Explanation legal
return true;
}
or
//Calculate the normal telephone and fax numbers: it can start with "+", except for the number, it can contain "-"
function isTel(s)
{
//var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?(\d){1,12})+$/;
var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;
if (!(s)) return false
return true
}
or
Require:
(1) Phone number consists of numbers, "(", ")" and "-"
(2) Phone numbers are 3 to 8 digits
(3) If the phone number contains an area code, then the area code is three or four digits
(4) Area codes are separated from other parts by "(", ")" or "-"
(5) The mobile phone number is 11 or 12 digits. If it is 12 digits, then the first digit is 0
(6) The first and second digits of the 11-digit mobile phone number are "13"
(7) The second and third digits of the 12-digit mobile phone number are "13"
According to these rules, the following regular expressions can be drawn:
(^[0-9]{3,4}\-[0-9]{3,8}$)|(^[0-9]{3,8}$)|(^\([0-9]{3,4}\)[0-9]{3,8}$)|(^0{0,1}13[0-9]{9}$)
function PhoneCheck(s) {
var str=s;
var reg=/(^[0-9]{3,4}\-[0-9]{3,8}$)|(^[0-9]{3,8}$)|(^\([0-9]{3,4}\)[0-9]{3,8}$)|(^0{0,1}13[0-9]{9}$)/
alert((str));
}
<input type="text" name="text1" onblur="istel(this);" />
10.//Check whether num is a negative number when opt2 is 1 //Check whether num is a decimal number when opt1 is 1 // Returning 1 is correct, 0 is wrong
function chknbr(num,opt1,opt2)
{
var i=;
var staus;
// Staus is used to record the number of .
status=0;
if ((opt2!=1) && ((0)=='-'))
{
alert("You have enter a invalid number.");
return 0;
}
//An error occurred when the last bit is.
if ((i-1)=='.')
{
alert("You have enter a invalid number.");
return 0;
}
for (j=0;j<i;j++)
{
if ((j)=='.')
{
status++;
}
if (status>1)
{
alert("You have enter a invalid number.");
return 0;
}
if ((j)<'0' || (j)>'9' )
{
if (((opt1==0) || ((j)!='.')) && (j!=0))
{
alert("You have enter a invalid number.");
return 0;
}
}
}
return 1;
}
11. Check whether a string consists of numbers or letters
function test(str)
{
var strSource ="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
var ch;
var i;
var temp;
for (i=0;i<=(-1);i++)
{
ch = (i);
temp = (ch);
if (temp==-1)
{
alert("Incorrect format!");
return false;
}
}
if ((ch)==-1)
{
alert("Incorrect format!");
return false;
}
else
{
return true;
}
}
12. Digital Verification
Positive integer verification^[1-9]\d*$, Negative integer verification^-[1-9]\d*$, integer^-?[1-9]\d*$, non-negative integer^[1-9]\d*|0$, non-positive positive number^-[1-9]\d*|0$, floating point number^-?([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0)$
function test(str){
if(/^[1-9]\d*$/.test(str))
{
alert("Format cannot!");
return false;
}
else
{
return true;
}
}
13. Identity card
Regular:\d{15}|\d{18}
address
Regular:\d+\.\d+\.\d+\.\d+
15. Postal Code
Regular:[1-9]\d{5}(?!\d)
function isPostalCode(s)
{
//var patrn=/^[a-zA-Z0-9]{3,12}$/;
var patrn=/^[a-zA-Z0-9 ]{3,12}$/;
if (!(s)) return false
return true
}
Number
Regular:[1-9][0-9]{4,}
mark
Regular:\d{3}-\d{8}|\d{4}-\d{7}
18. Whether the color value is valid
function IsColor(color){
var temp=color;
if (temp=="") return true;
if (!=7) return false;
return ((/\\#[a-fA-F0-9]{6}/) != -1);
}
19. Is it valid?
function IsURL(url){
var sTemp;
var b=true;
sTemp=(0,7);
sTemp=();
if ((sTemp!="HTTP://")||(<10)){
b=false;
}
return b;
}
20. Is the mobile phone number valid?
function IsMobile(_str){
var tmp_str = trim(_str);
var pattern = /13\\d{9}/;
return (tmp_str);
}
or
//Calculate the mobile phone number: It must start with a number, except for the number, it can contain "-"
function IsMobile(s)
{
var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;
if (!(s)) return false
return true
}
Address and ID number verification (regular)
function checkIP()
{
obj=("ip").value
//IP address
//var exp=/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;
//ID card
//var exp=/\b(((?!\d\d\d)\d+|1\d\d|2[0-4]\d|25[0-5])(\b|\.)){4}/
//var exp=/^(\d{15}|\d{17}[x0-9])/
//var exp=/^([\d]{15}|[\d]{18}|[\d]{17}[x|X])$/
var reg = (exp);
if(reg==null)
{
alert("IP address is illegal!");
}
else
{
alert("The IP address is legal!");
}
}
22. Verify the login name: Only enter 5-20 strings that start with letters and can have numbers, "_", "."
function isRegisterUserName(s)
{
var patrn=/^[a-zA-Z]{1}([a-zA-Z0-9]|[._]){4,19}$/;
if (!(s)) return false
return true
}
23. Verify user name: Only 1-30 strings starting with letters can be entered
function isTrueName(s)
{
var patrn=/^[a-zA-Z]{1,30}$/;
if (!(s)) return false
return true
}
24. Verify password: Only 6-20 letters, numbers, and underscores can be entered
function isPasswd(s)
{
var patrn=/^(\w){6,20}$/;
if (!(s)) return false
return true
}
25. Date and time category
Short time, like (13:04:06)
function isTime(str)
{
var a = (/^(\d{1,2})(:)?(\d{1,2})\2(\d{1,2})$/);
if (a == null) {alert('The input parameter is not the time format'); return false;}
if (a[1]>24 || a[3]>60 || a[4]>60)
{
alert("Time format is incorrect");
return false
}
return true;
}
Short date, like (2003-12-05)
function strDateTime(str)
{
var r = (/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/);
if(r==null)return false;
var d= new Date(r[1], r[3]-1, r[4]);
return (()==r[1]&&(()+1)==r[3]&&()==r[4]);
}
For a long time, it looks like (2003-12-05 13:04:06)
function strDateTime(str)
{
var reg = /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/;
var r = (reg);
if(r==null)return false;
var d= new Date(r[1], r[3]-1,r[4],r[5],r[6],r[7]);
return (()==r[1]&&(()+1)==r[3]&&()==r[4]&&()==r[5]&&()==r[6]&&()==r[7]);
}
26. Judgment characters are all composed of letters of a-Z or A-Z
<input onblur="if(/[^a-zA-Z]/())alert('Wrong')">
27. Judgment characters consist of letters and numbers, underscores, and dots. The only thing that starts is underscores and letters.
<input onblur="if(/^([a-zA-z_]{1})([\w]*)$/())alert('Wrong')">
28. The value of the form cannot be empty, cannot exceed imax characters, cannot be less than imix characters, and the input is Chinese judgment
function isNull(elem){
//var pattern=/^\s+|\s+$/;
if((/(^\s+|\s$)/g, "")==""){
return false;
}else{
return true;
}
}
function imax(elem){
if(>imax){
return false;
}else{
return true;
}
}
function imix(elem){
if( false;
}else{
return true;
}
}
function isChinese(elem){
var pattern=/[^\x00-\xff]/g;
if((elem)){
//Includes Chinese
return false;
}else{
//Not included in Chinese
return true;
}
}