JavaScript automatic calibration function (5) - Float check

xiaoxiao2021-03-06  29

/ *** Checkfloat function verifies whether this box is input to the FLOAT type data, the returned value is true and false, True and false; ** Object target object, Desc Chinese description. * /

Function Checkfloat (Object, DESC) {

Var strfloat = Object.value;

IF (Strvalue.Length == 0)

{

Return True;

}

Else

{

VAR pattern = / ^ (-? / d ) (/./ d )?

IF (strfloat.match () == null) {

Alert ("" desc "" must be a number, please modify! ");

Object.focus ();

Return False;

} else {

Return True;

}

}

}

转载请注明原文地址:https://www.9cbs.com/read-82519.html

New Post(0)