See also: fvEmail

Function used to determine whether the passed value is a valid email address.

Syntax

JSV_fsEmail(expV)

Prototype

n/a

Returns

The fsEmail function returns VALID if expV is a valid e-mail address, EMPTY if expV is empty; otherwise, INVALID.

Parameters

The fsEmail function uses the following arguments.

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

Remarks

n/a

Dependencies

JSV_isWhitespace

Example

The following lines of code

function CheckField() {
    var isEmail = JSV_fsEmail(document.EmailFieldForm.MyEmailAddress.value);
    if (isEmail == EMPTY)
        alert("This field DOES NOT contain an e-mail address.");
    else if (isEmail == INVALID)
        alert("This field contains an INVALID e-mail address.");
    else
        alert("This field contains a VALID e-mail address.");
}

<FORM NAME="EmailFieldForm">
<B>Email:</B>
<INPUT TYPE="Text" NAME="MyEmailAddress" SIZE="50" MAXLENGTH="255">
<INPUT TYPE="Button" NAME="EmailCheck" VALUE="Check" onClick="CheckField();">
</FORM>

produce

Enter an e-mail address and click the Check button.

Email: