Summary: Analyzes your vf-configuration, and crashes with descriptive error messages when necessary.
Function | Summary |
cibVFCfg |
Analyzes the validate_form.js configuration, and crashes with a descriptive error message when a problem is detected. |
ciAttrIncmptbl |
Are the attributes associated to this object compatible with both the object and each other? |
cibSprWSbRngFLS |
For validate_form.js features having sub-range-attributes, if the provided bounds are bad, crash with a descriptive error message. If the provided bounds are valid, do nothing. |
vf_cibVFCfg.js
: OverviewAnalyzes your vf-configuration, and crashes with descriptive error messages when necessary.
See the cibc tutorial for implementation details.
vf_cibVFCfg
.cibVFCfg()
Analyzes the validate_form.js
configuration, and crashes with a descriptive error message when a problem is detected.
Use dbgVF()
for diagnostic help.
a_flStats
: The array of object stats representing the form to analyze. Element zero must be the form itself, and every other element must be the elements in that form. REQUIRED and must a good array, and each element must be an FLStats
object.a_flStats
having an error has its sUsrErr
set to the specific error message, as configured by you (via sMsg*
attributes). Consider using frm_lmnt_stats.gtAFLSUsrErrs()
to aggregate the errors into an alert()
-able format.cibVFCfg(a_flStats)
vf_cibVFCfg
.ciAttrIncmptbl()
Are the attributes associated to this object compatible with both the object and each other?
This enforces that this table is correct.
fl_stats
: The FLStats
object. REQUIRED.ciAttrIncmptbl(fl_stats)
vf_cibVFCfg
.cibSprWSbRngFLS()
For validate_form.js
features having sub-range-attributes, if the provided bounds are bad, crash with a descriptive error message. If the provided bounds are valid, do nothing.
The purpose of this function is to detect and notify of any violations regarding the parameters s_msgSprAttr
, id_min
and id_max
. These are errors that can occur by the developer (the person who downloaded validate_form.js
, and is creating a form validaton scheme for their users), and that developer should be notified that they're using validate_form.js
incorrectly.
If there is a violation regarding any parameter aside from s_msgSprAttr
, id_min
or id_max
, this means that the validate_form.js
code itself is in error, which is a bad thing. Please report any such problems to the sourceforge.net bug forums. Thanks. :' )
Other information: Error codes and range info.
Required is denoted by '*'. Non-required parameters must be provided as undefined
.
Parameter | When provided, it... | Description |
fl_stats * |
...must be of type FLStats. | The FLStats object for this form element. Used for potential error messages only. |
bs_decOrInt * |
...must be a string equal to 'true' or 'false'. | Is this boundary defined by integers or decimals? If 'true', then id_min , id_max , id_absMin , and id_absMax (when provided) must each be decimals. If 'false', they must be integers.. |
bs_rangeRqd- * |
...must be a string equal to 'true' or 'false'. The dash is not part of the name. | If the super attribute (s_msgSprAttr ) is provided, is it required that the range (id_min and/or id_max ) also be provided? If 'true', then yes. If 'false', no.. |
id_absMin |
...must be a legal integer or decimal number. | The absolute minimum value that both id_min and id_max may be. Must be an decimal if bs_decOrInt equals 'true' and an integer if bs_decOrInt equals 'false'. and must be less than or equal to id_absMax , if that is provided |
id_absMax |
...must be a legal integer or decimal number. | The absolute maximum value that both id_min and id_max may be. Must be an decimal if bs_decOrInt equals 'true' and an integer if bs_decOrInt equals 'false'. and must be greater than or equal to id_absMin , if it is provided (defined). |
s_msgSprAttr |
The super attribute, which is also the user error message, when they violate the range. This should only be provided when you desire this attribute to be associated to the form element. If it is provided, then at least one of id_min and id_max must be provided. If this is not provided, neither id_min and id_max may not be provided. |
|
id_min ('id' stands for 'int or decimal') |
...must conform to all the following rules:
|
The minimum bound. |
id_max |
...must conform to all the following rules:
|
The maximum bound. |
s_nameSprAttr * |
...should be in the form 'f_orm.element.superproperty '.
|
The name of the super attribute, for which these boundaries are required. For potential error messages only. |
s_nameMin * |
...should be in the form 'f_orm.element.minimumproperty '.. |
The conceptual name of the id_min bound, for potential error messages only. |
s_nameMax * |
...should be in the form 'f_orm.element.maximumproperty '. |
The conceptual name of the id_max bound, for potential error messages only. Note that this must be in the form 'f_orm.element.maximumproperty'. See documentation for s_nameMin for examples. |
s_extraErrInfo |
Any extra information, if any, that may be useful in a (potential) error message. Will be preceded by 'Extra info: '. Will be concatenated to the end of any error message. |
cibSprWSbRngFLS()
: ERROR CODESThe following errors short circuit in order. For example, if cibsws5
is detected, then cibsws7
will never be analyzed for, even though it may also represent a current problem.
Code | Condition |
vf.cibsws1 and vf.cibsws2 |
Sanity checks only. You should never see these unless I've made a serious boo boo. |
vf.cibsws3 |
The super attribute is undefined, but one of the sub attributes are defined. |
vf.cibsws4 |
The super attribute is defined, but both sub-attributes are undefined. |
vf.cibsws5 |
Both the super and min bound sub-attributes are defined, but the min bound is (individually) invalid (not a decimal/int when it should be, or exceeds any existing abs bounds). |
vf.cibsws6 |
Both the super and max bound sub-attributes are defined, but the max bound is (individually) invalid. |
vf.cibsws7 |
The super and min and max bound sub-attributes are all defined, but the min and max bounds are invalid (min is greater than max). |
cibSprWSbRngFLS()
: Range detailsHere is a list of every attribute avaliable in validate_form.js
that has a super attribute associated to sub-attributes that define a range. sif-attributes are special and handled elsewhere.
Element type | Super attribute | Absolute minimum |
Absolute maximum |
Range required when Super attribute defined? |
text * |
sMsgBadLength |
0 | - (or MAXLENGTH ) ** |
x |
textarea |
sMsgBadLength |
0 | - | x |
text |
sMsgTxtInt |
- | - | |
text |
sMsgTxtDec *** |
- | - | |
checkbox **** |
sMsgMCRange |
1 | # of options | x |
select-multiple |
sMsgMCRange |
1 | # of options | x |
* Items applying to text
elements in this chart, also apply to password
elements.
** text.sMsgBadLength
has no absolute maximum when the standard MAXLENGTH
attribute is not provided. When MAXLENGTH
is provided, then that is its absolute maximum.
*** sMsgTxtDec
is the only attribute where the bounds must be decimal, instead of int. Notice also that this attritute has no absolute bounds.
**** Checkbox- and radio-sets are the only element types with
special naming conventions.
cibSprWSbRngFLS(fl_stats, bs_decOrInt, bs_rangeRqdIfSprPrvd,
id_absMin, id_absMax,
s_msgSprAttr, id_min, id_max,
s_nameSprAttr, s_nameMin, s_nameMax,
s_extraErrInfo)
___RPLC___ vfjs_doc_footer ___RPLCZ___