Summary: Define and manage a "string-integer" format, to be used by validate_form.js to enforce values are legal values for items such as phone numbers, zip codes and social security numbers.

Function Summary
SIFmt Constructor: Create a new SIFmt.
pb_isFmtEq Is the provided SIFmt's format equal to this SIFmt's format?
gtDgts Get the provided string after eliminating all non-digits.
pb_gtFmtV When valid for this format, get the digits from value string.


si_fmt.js: Overview

Define and manage a "string-integer" format, to be used by validate_form.js to enforce values are legal values for items such as phone numbers, zip codes and social security numbers.

"String-integer" means an integer that is held inside a string variable. The reason to keep it a string is to preserve leading zeros. The actually-and-currently configured sif-attributes are listed at SIFmt-Attributes sMsgTxt*. For implementation details, see Tutorial: SIFmt sMsgTxt* attributes.

Configuring your own SIFmt attributes

When you originally downloaded validate_form.js, this is the code that ../../si_fmt_CONFIGURATION.js contained:

//As defined in and required by validate_form.js.  This
//notifies all other code that this JavaScript file has
//indeed been loaded.
bLDD_SIF_CFG = true;

//Zip5     A five-digit U.S. zip code.
//Zip5p4   A five-digit U.S. zip code with an optional four-digit postfix.
//Phone7   A seven-digit U.S. phone number.
//Phone10  A ten digit U.S. phone number
//Ssn      A nine-digit U.S. Social Security Number

var aSIFmt = [
   new SIFmt("Zip5", "00001", "99999"),
   new SIFmt("Zip5p4", "00001", "99999", "0001", "9999"),
   new SIFmt("Phone7", "1001000", "9999999"),
   new SIFmt("Phone10", "1001001000", "9999999999"),
   new SIFmt("Ssn", "000000001", "999999999")
];

//vf_stASIF.stASIF()
stASIF(aSIFmt);

Change the contents of this file to be whatever you like (consider backing up this file consistently and frequently), or comment out the call to stASIF, to have no sif-attributes at all.







TOP     si_fmt.SIFmt()

Constructor: Create a new SIFmt.

PARAMETERS

SIGNATURE

SIFmt(s_msgTxtPostfix, si_rqdMin, si_rqdMax, si_altMin, si_altMax)





TOP     si_fmt.pb_isFmtEq()

Is the provided SIFmt's format equal to this SIFmt's format?

PARAMETERS

RETURNS

SIGNATURE

pb_isFmtEq(si_fmt)





TOP     si_fmt.gtDgts()

Get the provided string after eliminating all non-digits.

PARAMETERS

RETURNS

SIGNATURE

gtDgts(s_tring)





TOP     si_fmt.pb_gtFmtV()

When valid for this format, get the digits from value string.

PARAMETERS

RETURNS

SIGNATURE

pb_gtFmtV(s_value)





























___RPLC___ vfjs_doc_footer ___RPLCZ___