Summary: A wrapper for form objects (the form itself and elements therein).

Function Summary
FLStats Constructor: Create a new FLStats with the provided form/form-element, form-FLStats, and previous-array-of-FLStats.
gtAFLSUsrErrs Accumulate all user form error messages into a single, alert()-ready string.
gtAFLS Get an array of FLStats representing the provided form. Call this at form submission to analyze the form and create the aFLStats array based upon it.
pb_useThisFLS After calling the cnstr (which analyzes an element or form), call this function to determine if this analysis resulted in an FLStats that should be regarded or discarded.
pb_gtCd4Attr Get the code for the provided attribute on this form/element.
pb_gtCdAttrNm Get the code for [this element].[provided attribute].
pb_gtCdFLSNm Get the code for this FLStats' name.
pb_gtAttrVRaw Get the value of the attribute, whether or not it is actually associated to the element.
pb_isAttrAssc2Lmnt Has a certain attribute actually been associated to this element?
pb_gtAttrV Get the value of the attribute, whether or not it is actually associated to the element.
pb_isLmntVal1OrMore Is the value of this element single- or multiple-valued?
pb_gtLmntValSnglr Get the singular value for this element.
pb_gtLmntOptsTotal Get the number of total options in this multiple-value element. May only be called when isLmntVal1OrMore() returns false.
pb_gtLmntOptsChosen Get the number of total options in this multiple-valued form element.
pb_gtEvlCdLmntAttrNm Get the name of this object-plus-the-provided-attribute, suitable for 'eval'uation.
pb_gtEvlCdObjNm Get the name of this object, suitable for 'eval'uation.


fl_stats.js: Overview

A wrapper for form objects (the form itself and elements therein).

Using FLStats

This class is automatically used by validate_form.js, so you don't need to directly use this object at all.

To create an array of FLStats for your form, try the following:

function nlzForm(f_orm) { var aFLStats = gtAFLS(f_orm); dbgAFLS(aFLStats); } ...
...

Local and public FLStats variables

Except for sUsrErr, all these variables are to be treated as read-only. Changing their values will result in unpredictable behavior. Attributes or functions not listed in this documentation should not be accessed.

When this.sType equals 'form', the following attributes will all be undefined: this.sAftrFrmNm, this.sAftrAttrNm, this.iTotOpts , this.sUsrErr and this.flsFrm

Notes







TOP     fl_stats.FLStats()

Constructor: Create a new FLStats with the provided form/form-element, form-FLStats, and previous-array-of-FLStats.

PARAMETERS

DISCARED OR USE?

After using this cnstr, useThisFLS() must be called to determines if this FLStats is worthy of keeping, or should be discarded.

validate_form.js only handles certain types of form elements. For example, it does not handle hidden, button, submit or reset elements. Also, each checkbox/radio set (set of checkbox or radio elements) has a single FLStats, representing it as a whole. The second and subsequent checkbox/radio must be discarded for validate_form.js to work properly.

NOTE

SIGNATURE

FLStats(frm_frmLmnt, fls_frm, a_prevFLS)





TOP     fl_stats.gtAFLSUsrErrs()

Accumulate all user form error messages into a single, alert()-ready string.

PARAMETERS

SIGNATURE

gtAFLSUsrErrs(a_flStats, s_header, s_linePre, s_footer)





TOP     fl_stats.gtAFLS()

Get an array of FLStats representing the provided form. Call this at form submission to analyze the form and create the aFLStats array based upon it.

PARAMETERS

RETURNS

SIGNATURE

gtAFLS(f_orm)





TOP     fl_stats.pb_useThisFLS()

After calling the cnstr (which analyzes an element or form), call this function to determine if this analysis resulted in an FLStats that should be regarded or discarded.

If this returns true, then use the object you just created via the cnstr, otherwise discared it.

   var os = new FLStats(f_orm[i]);
      if(os.useThisFLS())  {
         //os should be kept.
      }  else  {
         //os should be discarded.
      }

Elements that should be discarded include:

NOTE: This function can only be called once per object.

SIGNATURE

useThisFLS()





TOP     fl_stats.pb_gtCd4Attr()

Get the code for the provided attribute on this form/element.

PARAMETERS

RETURNS

SIGNATURE

gtCd4Attr(s_attrNm)





TOP     fl_stats.pb_gtCdAttrNm()

Get the code for [this element].[provided attribute].

To get the code for the value, call [util_string.]gtCd4V(this.gtAttrV(s_attrNm)).

PARAMETERS

RETURNS

SIGNATURE

gtCdAttrNm(s_attrNm)





TOP     fl_stats.pb_gtCdFLSNm()

Get the code for this FLStats' name.

PARAMETERS

RETURNS

SIGNATURE

gtCdFLSNm()





TOP     fl_stats.pb_gtAttrVRaw()

Get the value of the attribute, whether or not it is actually associated to the element.

PARAMETERS

RETURNS

SIGNATURE

gtAttrVRaw(s_attrNm)





TOP     fl_stats.pb_isAttrAssc2Lmnt()

Has a certain attribute actually been associated to this element?

PARAMETERS

RETURNS

SIGNATURE

isAttrAssc2Lmnt(s_attrNm)





TOP     fl_stats.pb_gtAttrV()

Get the value of the attribute, whether or not it is actually associated to the element.

PARAMETERS

RETURNS

SIGNATURE

gtAttrV(s_attrNm)





TOP     fl_stats.pb_isLmntVal1OrMore()

Is the value of this element single- or multiple-valued?

RETURNS

SIGNATURE

isLmntVal1OrMore()





TOP     fl_stats.pb_gtLmntValSnglr()

Get the singular value for this element.

Always use this function to get the value, although you must set the value manually, via the object, obj.

May only be called when isLmntVal1OrMore() returns true.

SIGNATURE

gtLmntValSnglr()





TOP     fl_stats.pb_gtLmntOptsTotal()

Get the number of total options in this multiple-value element. May only be called when isLmntVal1OrMore() returns false.

SIGNATURE

gtLmntOptsTotal()





TOP     fl_stats.pb_gtLmntOptsChosen()

Get the number of total options in this multiple-valued form element.

This may only be called when this.sType equals something other than 'form', and isLmntVal1OrMore() is false.

SIGNATURE

gtLmntOptsChosen()





TOP     fl_stats.pb_gtEvlCdLmntAttrNm()

Get the name of this object-plus-the-provided-attribute, suitable for 'eval'uation.

PARAMETERS

RETURNS

SIGNATURE

gtEvlCdLmntAttrNm(s_attrNm)





TOP     fl_stats.pb_gtEvlCdObjNm()

Get the name of this object, suitable for 'eval'uation.

RETURNS

SIGNATURE

gtEvlCdObjNm()





























___RPLC___ vfjs_doc_footer ___RPLCZ___