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