Author: AustinLei Time: 2004-11-01 Document Type: Reprinted from: 9CBS View statistics total: 4896 | year: 651 | Quarter: 651 | Month: 651 | Week: 64 | today: 15
// 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 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 NUM is negative // When the OPT1 is 1, it checks whether NUM is decimal // Return 1 is correct, 0 is the wrong function chknbr (Num, OPT1 , OPT2) {var i = Num.length; var staus; // staus is used to record. Number status = 0; if ((OP T2! = 1) && (Num.Charat (0) == '-')) {// Alert ("You Have Enter A Invalid Number."); return 0;} // When the last bit is. 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 // function introduction: Check if the date // Parameter Description: String // Return value: 0: Not Date 1: Yes Function Chkdate (DateStr) {Var lthdatestr = 0; else = ""; var terester = "; var tmpm ="; var tmpd = "; // var datestr; var status; status; s 0; if (lthdatestr == 0) RETURN 0 for (i = 0; i
= 0) && (Month == 2) && (DAY == 29)) {// alert ("this is not a leap year!"); Return 0;} = ((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;}} ((Month == 2) && (day == 30)) {/ / Alert ("The Febryary NEVER HAS THIS Day!"); return 0;} Return 1;} // function name: fucpwdchk // function introduction: Check if a non-numeric or letter // parameter description: String to check // 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.length -1); i ) {CH = str.Charat (i); temp = strsource.indexof (ch); if (Temp == - 1) {RETURN 0;}} f (strsource.indexof (ch) == - 1) {RETURN 0;} else {return 1;}} function jtrim (str) {while (str.Charat (0) == "") {str.sustr (1);} while (str.charat (Str.Charat) Str.Length-1) == "" "{str.substr (0, str.length-1);} Return (STR);} // function name: fucchecknum // function introduction: Check if it is a number // parameter description: The number // return value to check: 1 is a number, 0 is not a digital function fucchecknum (NUM) { VAR I, J, STRTEMP; Strtemp = "0123456789"; if (Num.Length == 0) Return 0 for (i = 0; I