<<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
Defines a set of bad sub-strings that string values may not contain or equal. | Summary |
asGlobalBadSubStrs , bsNoBadSubStrs , asBadSubStrs , sMsgBadSubStr |
All Attributes |
txt pwd txa rdo sl1 chk slm |
Interactive Example Code |
Higher [ trm rqd len dec eml int sif mcr BSS ] LowerLowest priority of all |
Precedence |
[TOP] Bad Sub-Strings attribute: asGlobalBadSubStrs |
|
Value Purpose | The array of strings that all non-sMsgTxt string elements consider illegal.In my experience, the most commonly-needed bad sub-strings are the escape slash ('\') and the single quote ("'"), to protect against database and JavaScript errors. |
Value Rules | Must be a good array, and each element must be defined, at least one character in length, and unique. |
Object Compatibility |
form |
Attribute Compatibility |
bsGlobalTrimSpaces |
When Provided | sMsgBadSubStr must be provided and bsNoBadSubStrs may not be provided (see sMsgTxt element exceptions). |
When Not Provided | No element may have bsNoBadSubStrs associated to it. Any element having either sMsgBadSubStr or asBadSubStrs associated to it, must also associate the other. |
[TOP] Bad Sub-Strings attribute: bsNoBadSubStrs |
|
Value Purpose | Overrides form.asGlobalBadSubStrs for this single element, declaring all strings legal. |
Value Rules | Must be a string equal to 'true '.Note for all BooleanStrings: The only legal values for a BooleanString vf-attributes (those whose names start with ' |
Object Compatibility |
text , password , textarea |
Attribute Compatibility |
sMsgRequired , sMsgTxtDec , sMsgTxtEmail , sMsgTxtInt , sMsgBadLength , bsDontTrimSpaces , bsTrimSpaces , sMsgTxtZip5 , sMsgTxtZip5p4 , sMsgTxtPhone7 , sMsgTxtPhone10 , sMsgTxtSsn |
When Provided | form.asGlobalBadSubStrs must exist, and neither asBadSubStrs nor sMsgBadSubStr may be associated to the element (see sMsgTxt element exceptions). |
When Not Provided | sMsgBadSubStr must be associated to the element (given the 'sMsgTxt ' exception). |
[TOP] Bad Sub-Strings attribute: asBadSubStrs |
|
Value Purpose | The array of strings that this element's value considers illegal. When form.asGlobalSubStrs exists, this overrides it. |
Value Rules | Must be a good array, and each element must be defined, at least one character in length, and unique. |
Object Compatibility |
text , password , textarea |
Attribute Compatibility |
sMsgRequired , sMsgTxtDec , sMsgTxtEmail , sMsgTxtInt , sMsgBadLength , sMsgBadSubStr , bsDontTrimSpaces , bsTrimSpaces , sMsgTxtZip5 , sMsgTxtZip5p4 , sMsgTxtPhone7 , sMsgTxtPhone10 , sMsgTxtSsn |
When Provided | If form.asGlobalBadSubStrs exists, this overrides it for this element only. No matter what, sMsgBadSubStr must also be associated, and bsNoBadSubStrs may not be associated (see sMsgTxt element exceptions). |
When Not Provided | Unless form.asGlobalBadSubStrs is provided, sMsgBadSubStr may not exist. |
[TOP] Bad Sub-Strings attribute: sMsgBadSubStr |
|
Value Purpose | The error message presented to the user when the value contains or is equal to an illegal string. |
Value Rules | Must be a string at least one character in length. |
Object Compatibility |
text , password , textarea |
Attribute Compatibility |
sMsgRequired , sMsgTxtDec , sMsgTxtEmail , sMsgTxtInt , sMsgBadLength , asBadSubStrs , bsDontTrimSpaces , bsTrimSpaces , sMsgTxtZip5 , sMsgTxtZip5p4 , sMsgTxtPhone7 , sMsgTxtPhone10 , sMsgTxtSsn |
Special Strings |
|
When Provided | Either form.asGlobalBadSubStrs or asBadSubStr must be provided, and bsNoBadSubStrs may not be provided (see sMsgTxt element exceptions). |
When Not Provided | asBadSubStrs may not be provided. |
TOP Exceptions: sMsgTxt* elements and Bad Sub-String attributes
[ |
|||
When form.asGlobalBadSubStrs is provided: |
|||
When an sMsgTxt attribute is... |
...here are the rules for the below attributes for... | ...text / password elements... |
...and textarea elements |
...associated to the element... | bsNoBadSubStrs |
Forbidden. It is assumed there are no bad sub-strings unless sMsgBadSubStrs is provided. |
Not applicable |
sMsgBadSubStr |
Optional, unless asBadSubStrs is also provided, in which case this is required. When provided, then this element does have bad sub-strings. |
||
asBadSubStrs |
Optional. When provided, then this element overrides form.asGlobalBadSubStrs , to define a set of bad-sub-strings for this element only. |
||
...not associated to the element... | bsNoBadSubStrs |
Either this or sMsgBadSubStr is required |
|
sMsgBadSubStr |
Either this or bsNoBadSubStrs is required |
||
asBadSubStrs |
Optional. When provided, this overrides form.asGlobalBadSubStrs for this element only. |
||
When form.asGlobalBadSubStrs is not provided: |
|||
When an sMsgTxt attribute is... |
...here are the rules for the below attributes for... | ...text / password elements... |
...and textarea elements |
...associated to the element... | bsNoBadSubStrs |
Forbidden | Not applicable |
sMsgBadSubStr |
Forbidden, unless asBadSubStrs is also provided, in which case this is required. |
||
asBadSubStrs |
Optional | ||
...not associated to the element... | bsNoBadSubStrs |
Forbidden | |
sMsgBadSubStr |
Forbidden, unless asBadSubStrs is also provided, in which case this is required. |
||
asBadSubStrs |
Optional |
TOP
rqd dec eml int len mcr BSS trm sif |
|
VF-Config Snippet | f_orm.your_string.sMsgBadSubStr = 'The sub-string "~BSS_FOUND~" may not equal or be found in your string.\n\n\nAll bad sub-strings: ~BSS_LIST~'; |
Example Element | <INPUT TYPE="text" NAME="your_string"> |
Note the differences in behavior when sMsgTxtEmail
is also associated to the element.
The form | Change the vf-configuration |
Each string array element must be separated by ' |
|
TOP
rqd dec eml int len mcr BSS trm sif |
|
VF-Config Snippet | f_orm.secret_string.sMsgBadSubStr = 'The sub-string "~BSS_FOUND~" may not equal or be found in your *secret* string (shhhhh).\n\n\nAll bad sub-strings: ~BSS_LIST~'; |
Example Element | <INPUT TYPE="password" NAME="secret_string"> |
Note the differences in behavior when sMsgTxtEmail
is also associated to the element.
The form | Change the vf-configuration |
Each string array element must be separated by ' |
|
TOP
rqd dec eml int len mcr BSS trm sif |
|
VF-Config Snippet | f_orm.your_paragraph.sMsgBadSubStr = 'The sub-string "~BSS_FOUND~" may not equal, or be found in, your paragraph.\n\n\nAll bad sub-strings: ~BSS_LIST~'; |
Example Element | <TEXTAREA NAME="your_paragraph"></TEXTAREA> |
The form | Change the vf-configuration |
Each string array element must be separated by ' |
|
Copyright (C) 2003-2005, Jeff Epstein. All rights reserved.