// Function Name: Chksafe // Features: Check if "'",' // ', "/" // parameter description: String // Return value: 0: Yes 1: not function
Chksafe (a) {RETURN 1; / * fibdn = new array ("'", "//", ",", ","; "," / "); i = fibdn.length; j = a .length; for
(ii = 0; II
Return 0;}}} RETURN 1; * /} // function name: chKSPC // function introduction: Check if it contains space // parameter description: String // Return value to check: 0: Yes 1: Not Function CHKSPC (a) {var i = a.length; var j = 0; var k = 0; While (k
// Function Name: Chkemail // Features: Check if the email address // Parameter Description: String // Return Value: 0: Not 1: Yes 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;
// OPT1 decimal OPT2 negative number // Check NUM if the OPT2 is 1:// When the OPT1 is 1, check whether NUM is decumbion // Return 1 is correct, 0 is the wrong Function CHKNBR (Num, OPT1, OPT2 ) {Var i = Num.length; var staus; // staus is used to record. The number status = 0; IF ((OPT2! = 1) && (Num.Charat (0) == '-')) { // Alert ("You Have Enter A Invalid Number."); Return 0;} // When the last bit is. Error IF (Num.Charat (I-1) == '.') {// alert "You Have Enter a invalid Number."); Return 0;}
For (j = 0; j 1) {// alert ("You Have Enter A Invalid Number. "); RETURN 0;} IF (Num.Charat (j) <'0' || Num.Charat (j)> '9') {IF (((OPT1 == 0) || (Num.Charat (J )! = '.')) && (j! = 0)) {// Alert ("You Have Enter a invalid number."); return 0;}}} Return 1;} // Function Name: chkdate // Features: Check if the date // Parameter Description: String // Return Value: 0: Not Date 1: Yes Function Chkdate (DateStr) {var lthdateStr if (DateStr! = ") LTHDATESTR = DateStr. Length; else lthdatestr = 0; var tmpy = "; var tmpm =" "; var TMPD =" "; // var datestr; var status; status = 0; if (lthdatestr == 0) Return 0
For (i = 0; i
} Year = new string (tmpy); Month = new string (tmpm); day = new string (tmpd) // tempdate = new string (YEAR MONTH DAY); // Alert (Tempdate); if (((TMPY). Length! = 4) || (TMPM.LENGTH> 2) || (TMPD.LENGTH> 2)) {// Alert ("Invalid Format Of Date!"); Return 0;}} IF (! (1 <= Month) && (12> = month) && (31> = day) && (1 <= day))) {// Alert ("Invalid Month or Day!"); return 0;} if (! ("(Year%) 4) == 0) && (MONTH == 2) && (DAY == 29)) {// Alert ("this is not a leap year!"); Return 0;} IF ((Month <= 7) && ((MONTH% 2) == 0) && (day> = 31)) {// Alert ("this Month Is A SMALL MONTH!"); return 0;} IF ((Month> = 8) && ((Month) % 2) == 1) && (day> = 31)) {// Alert ("this Month Is A SMALL MONTH!"); Return 0;} IF ((MONTH == 2) && (day == 30) ) {// Alert ("THE Febryary NEVER HAS DAY!"); Return 0;} Return 1;} // function name: fucpwdchk // function introduction: Check if there is a non-numeric or letter // parameter description: To check // string return value: 0: 1 comprising: all numbers or letters function fucPWDchk (str) {var strSource = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; var ch; var i; var temp; for (i = 0; i <= ( Str.l ENGTH-1); i ) {ch = str.Charat (i); temp = strsource.indexof (ch); if (Temp == - 1) {RETURN 0;}} IF (strsource.indexof (ch) == -1) {return 0;} else {return 1;}}
Function Jtrim (STR) {while (str.charat (0) == "") {str.sustr (1);} while (str.charat (str.length-1) == "") {str = Str.Substr (0, str.Length-1);} return (str);} // function name: fucchecknum // function introduction: Check if it is a number // parameter description: To check the number // return value: 1 In order to be a number, 0 is not digital function fucchecknum (num) {var i, j, strTemp; startemp = "0123456789"; if (num.length == 0) Return 0 for (i = 0; i // Function name: fucchecktel // function introduction: Check if the phone number // parameter description: The string // return value to check: 1 is legal, 0 is the illegal function fucchecktel (tel) {var i, j , strtemp; strTemp = "0123456789 - () #"; for (i = 0; i // Function name: Fucchecklength // function introduction: Check the length of the string // Parameter Description: String // Return Value: Length value Function Fucchecklength (strTemp) {var i, sum; sum = 0; for i = 0; i // Function name: Dozoom // function introduction: Change the font in the page. Such as the size of the article font. The ID name of the page is taken to the page. Size is the font size function dozoom (ID, size) {document.getlementByid ( ID) .Style.FontSize = size "px"} // Function Name: ISEMAIL // Features: Verify that the value entered by the page is email format. // Parameter: Parameter is the input string function ISemail (String) {if (String.Search (/ ^ / w - / w ) | (/./ w )) * / @ [A-ZA-Z0-9] (/. | -) [A-ZA-Z0-9] ) * /. [A-ZA -z0-9] $ /)! = -1) Return true; else returnaf false;} // Function Name: Round // Features: Since the rounded function. // Parameter: V is the number taken, P is the number of bits behind the decimal point. Function Round (V, P) {Var Tempint, Tempdot, Temp, Power , xxrl temp = v; power = 1; for (var i = 0; i = 0.499) {Tempint = Tempint 1;} xxrl = parsefloat (Tempint / Power, 4); script>