| See also: fvEmail | |
Function used to determine whether the passed value is a valid email address.
JSV_fsEmail(expV)
n/a
The fsEmail function returns VALID if expV
is a valid e-mail address, EMPTY if expV is empty; otherwise, INVALID.
The fsEmail 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 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.
Copyright © 1998-2000 Roaring Fork Software. All rights reserved.