See also: fvInteger

Function used to determine whether the passed value is an integer.

Syntax

JSV_fsInteger(expV)

Prototype

n/a

Returns

The fsInteger function returns VALID if expV is a valid integer value, EMPTY if expV is empty; otherwise, INVALID.

Parameters

The fsInteger function uses the following arguments.

Argument Description
expV The information in the field (i.e., object.value).

Remarks

n/a

Dependencies

JSV_isWhitespace, JSV_isInteger

Example

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.

Integer Number: