function Isnum (num,low,hi) {if isNaN (num) | | num<low| | Num>hi) return false; return true;} function Isvalidip (v) {nums=v.split ("."); if (nums.length!=4) return false; for (j=0;j<4;j++) {if (!isnum (nums[j],0,255)) return false; return true;} function Checkip (object,desc,maybeempty) {var strvalue= object.value; if (maybeempty) {if (Strvalue.length ==0) {return true; } if (Isvalidip (strvalue) ==false) {alert (Desc + "Format error!"); Object.focus (); return false; return true;} function Checkport (object,desc,lowest,maybeempty) {var pattern=/^\d{4,5}$/; var strvalue= object.value; if (maybeempty) {if (Strvalue.length ==0) {return true; } if (Strvalue.match (pattern) = = null) {alert (Desc + "Format error!"); Object.focus (); return false; } if (Strvalue<lowest | | strvalue >65535) {alert (Desc + "Format error!"); Object.focus (); return false; return true;} function checkfitlongsTR (object,desc,maybeempty) {var pattern=/^\s{0,25}$/; var strvalue= object.value; if (maybeempty) {if (Strvalue.length ==0) {return true; } if (Strvalue.match (pattern) = = null) {alert (Desc + "Format error!"); Object.focus (); return false; return true;} function Checkfitlongnum (object,desc,maybeempty) {var pattern=/^\d{0,8}$/; var strvalue= object.value; if (maybeempty) {if (Strvalue.length ==0) {return true; } if (Strvalue.match (pattern) = = null) {alert (Desc + "Format error!"); Object.focus (); return false; return true;} function CHECKGC (object,desc) {var pattern =/^\-{0,1}\d{1,2}$/var strvalue = Object.value; if (Strvalue.length ==0) {return true; } if (Strvalue.match (pattern) = = null) {alert (Desc + "Format error!"); Object.focus (); return false; } if (strvalue <-12 | | strvalue >) {alert (Desc + "Format error!"); Object.focus (); return false; return true;}
|