See also: fvFloat |
Function used to determine whether the passed value is a float.
JSV_fsFloat(expV)
n/a
The fsFloat function returns VALID
if expV
is a valid floating point value, EMPTY
if expV is empty; otherwise, INVALID
.
The fsFloat function uses the following arguments.
Argument | Description |
expV | The information in the field (i.e., object.value). |
n/a
The following lines of code
function CheckField() {
var isFP = JSV_fsFloat(document.FloatingPointForm.MyFloat.value);
if (isFP == EMPTY)
alert("This field DOES NOT contain a floating point number.");
else if (isFP == INVALID)
alert("This field contains an INVALID floating point number.");
else
alert("This field contains a VALID floating point number.");
}
<FORM NAME="FloatingPointForm">
<B>Floating Point Number:</B>
<INPUT TYPE="Text" NAME="MyFloat" SIZE="8" MAXLENGTH="8">
<INPUT TYPE="Button" NAME="FloatCheck" VALUE="Check" onClick="CheckField();">
</FORM>
produce
Enter a floating point number and click the Check button.
Copyright © 1998-2000 Roaring Fork Software. All rights reserved.