/******************************************************** * * * ±âŸ µ¥ÀÌŸ Æ÷¸ä check ½ºÅ©¸³Æ® ¸ðÀ½ * * * ********************************************************/ /**###################################################################### FUNCTION : IsInt INPUT : numStr, allowNegatives RETURN : boolean DESC : 0-9 »çÀÌ Á¤¼ö¸¸ Æ÷ÇԵǾî¾ß true allowNegatives°¡ trueÀϰæ¿ì '-'·Î ½ÃÀÛÇÏ´Â Á¤¼ö´Â true CALLS : IsBlank() ######################################################################**/ function IsInt(numStr, allowNegatives ) { if (IsBlank(numStr)) return false; if (allowNegatives+"" == "undefined" || allowNegatives+"" == "null") allowNegatives = true; var isValid = true; numStr += ""; for(i=0; i= "0") && (numStr.charAt(i) <= "9") || (numStr.charAt(i) == "-"))) { isValid = false; break; } else if((numStr.charAt(i) == "-" && i != 0) || (numStr.charAt(i) == "-" && !allowNegatives)) { isValid = false; break; } } return isValid; } /* ###################################################################### FUNCTION : IsNull INPUT : string RETURN : boolean DESC : StringÀÇ Null¿©ºÎ¸¦ ÆÇ´Ü, NullÀ̸é true, NullÀÌ ¾Æ´Ï¸é false CALLS : None ###################################################################### */ function IsNull( val ) { if (val+"" == "null") return true; else return false; } /* ###################################################################### FUNCTION : IsUndef INPUT : string RETURN : boolean DESC : StringÀÌ Undefined¿©ºÎ¸¦ ÆÇ´Ü, UndefinedÀ̸é true, UndefinedÀÌ ¾Æ´Ï¸é false CALLS : None ###################################################################### */ function IsUndef( val ) { if (val+"" == "undefined") return true; return false; } /* ###################################################################### FUNCTION : IsBlank INPUT : string RETURN : boolean DESC : StringÀÌ °ø¹é¿©ºÎ¸¦ ÆÇ´Ü, °ø¹éÀ̸é true, °ø¹éÀÌ ¾Æ´Ï¸é false CALLS : IsNull(), IsUndef() ###################################################################### */ function IsBlank(str) { if(IsNull(str) || IsUndef(str) || (str+"" == "")) return true; else return false; } /* ###################################################################### FUNCTION : checkRange INPUT : checkNum, fromNum, toNum RETURN : boolean DESC : ÀԷ°ªÀÌ ¹üÀ§³»¿¡ À§Ä¡ÇÏ´ÂÁö ÆÇ´Ü, ¹üÀ§³»À̸é true, ¹üÀ§¹ÛÀ̸é false CALLS : None ###################################################################### */ function checkRange(checkNum, fromNum, toNum) { if(checkNum < fromNum || checkNum > toNum) { return false; } else { return true; } }