<<BACK HOME CNCPT TTRL JS | sf.net/projects/validateformjs | [ U | s | m | ? ] |
rqd dec eml int len mcr bss trm SIF | All Concepts | |
frm txt pwd txa rdo sl1 chk slm | All Object Types |
validate_form.js
SIFmt
-Attributes (sMsgTxt*
)Ensures string values are validly-formatted 'string-integers', such as phone numbers, zip codes and Social Security Numbers. | Summary |
sMsgTxtZip5 , sMsgTxtZip5p4 , sMsgTxtPhone7 , sMsgTxtPhone10 , sMsgTxtSsn |
All Attributes |
txt pwd txa rdo sl1 chk slm |
Interactive Example Code |
Higher [ trm rqd len dec eml int SIF mcr bss ] Lower |
Precedence |
[TOP] SIFmt -Attributes (sMsgTxt* ) attribute: sMsgTxt* |
|
Value Purpose | The error message presented to the user when the value is not valid according to your SIFmt -Attribute configuration. |
Value Rules | Must be a string at least one character in length. Note there are special restrictions on |
Object Compatibility |
text , password |
Attribute Compatibility |
sMsgRequired , sMsgTxtDec , sMsgTxtEmail , sMsgTxtInt , sMsgBadLength , bsNoBadSubStrs , asBadSubStrs , sMsgBadSubStr , bsDontTrimSpaces , bsTrimSpaces |
Understanding SIFmt -Attributes |
||||||||||||||||||||||||||||||||
What | Purpose/Description | |||||||||||||||||||||||||||||||
GO |
Tutorial: SIFmt Attributes |
Demonstrates how sif-attributes are implemented. Uses the default configuration. | ||||||||||||||||||||||||||||||
GO |
../../../ si_fmt_CONFIGURATION.js |
The file containing your currently-and-actually-configured sif-attributes.
Here are your actually-and-currently configured sif-attributes, existing in
Note that the ' It is recommended, although not required that your sif-attributes be configured in |
||||||||||||||||||||||||||||||
GO |
si_fmt.js |
JavaScript class to defines and manage sif-attributes. If your formats are invalid for any reason, the constructor for this class is what will crash and inform you of that error. | ||||||||||||||||||||||||||||||
vf_stASIF.stASIF() |
Function that SIFmt configuration must be passed to, for validate_form.js to recognize it. |
|||||||||||||||||||||||||||||||
GO |
../../../secondary_js/ si_fmt_CONFIGURATION_default.js |
The configuration that originally existed in si_fmt_CONFIGURATION.js when you downloaded validate_form.js (do not touch this file). Consider this the 'default' configuration.
Here are the default sif-attribute configuration, existing in
|
||||||||||||||||||||||||||||||
GO |
Further Resources |
|
TOP
rqd dec eml int len mcr bss trm SIF |
|
VF-Config Snippet | f_orm.your_sif_value.sMsgTxtZip5 = 'That is not a legally-formatted 'Zip5'.'; |
Example Element | <INPUT TYPE="text" NAME="your_sif_value"> |
There is another example where MAXLENGTH
is also associated to the element.
The form | Change the vf-configuration |
SIFmt
Attribute Example: A 'text
' element with MAXLENGTH
associated to it.VF-Config Snippet | f_orm.your_sif_value.sMsgTxtZip5 = 'That is not a legally-formatted 'Zip5'. |
Example Element | <INPUT TYPE="text" MAXLENGTH="9" NAME="your_sif_value"> |
It is recommended that MAXLENGTH
not be associated to SIFmt
elements. If it is, though, MAXLENGTH
may not be greater than the SIFmt
-s required part (the si_rqdMin
constructor parameter). In this example, sMsgTxtPhone10
crashes because of a conflict with MAXLENGTH
.
The form | Change the vf-configuration |
TOP
rqd dec eml int len mcr bss trm SIF |
|
VF-Config Snippet | f_orm.secret_sif_value.sMsgTxtZip5 = 'The *secret* value (shhhhh) is not a legally-formatted 'Zip5'.'; |
Example Element | <INPUT TYPE="password" NAME="secret_sif_value"> |
The form | Change the vf-configuration |
Copyright (C) 2003-2005, Jeff Epstein. All rights reserved.