Field functions are those that allow the user to work with HTML <INPUT>
,
<SELECT>
objects.
These functions include the ability to check the validity of an e-mail address, a date,
an integer, or a floating point number.
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript" SRC="JS_Vision_Globals.js"></SCRIPT>
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript" SRC="JS_Vision_Character.js"></SCRIPT>
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript" SRC="JS_Vision_String.js"></SCRIPT>
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript" SRC="JS_Vision_Numeric.js"></SCRIPT>
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript" SRC="JS_Vision_DateTime.js"></SCRIPT>
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript" SRC="JS_Vision_Field.js"></SCRIPT>
|
The functions that are named with an fv (field validation) are designed to be used in the
onBlur
or onChange
attribute of the <INPUT>
tag
since these functions take the object as input. For examples, see each of the fv functions.
The functions that are named with an fs (field script) are designed to be used in the user's JavaScript code, especially when writing a validation function for a form. For example, your call to the <FORM> tag may look like this:
<FORM NAME="MyTestForm" ACTION="myFormPost.cfm" METHOD="POST" onSubmit="return formCheck();">
<INPUT TYPE="Text" NAME="UserInteger" SIZE="5" MAXLENGTH="5">
<INPUT TYPE="Submit" NAME="fSubmit" VALUE="Submit">
</FORM>
and the JavaScript form validation code may look like this:
function formCheck() {
if (JSV_fsInteger(document.MyTestForm.UserInteger.value) != VALID) {
alert("Before the form can be submitted, " +
"an integer must be entered in the field.");
return false;
}
else{
return true;
}
}
For more information on the SRC
attribute of the SCRIPT
tag, see JavaScript Vision
Frequently Asked Questions.
Copyright © 1998-2000 Roaring Fork Software. All rights reserved.