<<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
si_fmt.js
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
: OverviewDefine 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.
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
|
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.
si_fmt
.SIFmt()
Constructor: Create a new SIFmt
.
sMTPost
: The string to use as the postfix for the validate_form.js
'sMsgTxt*
' attribute. For example, if this is 'Ssn
', then the attribute for it is named 'sMsgTxtSsn
'. REQUIRED, may not be less than one character in length, or equal 'Dec', 'Email', or 'Int', and may contain only letters, digits and underscores.si_rqdMin
: The minimum allowable value for the required part of the format. REQUIRED and must be at least one digit, and the same length as, but not greater than si_rqdMax
.si_rqdMax
: The maximum allowable value for the required part of the format. REQUIRED and must be at least one digit, and the same length as, but not less than si_rqdMin
.si_altMin
: The minimum allowable value for the alternate part of the format. When provided, it must be at least one digit, and the same length as, but not greater than si_altMax
(which must also be provided).si_altMax
: The maximum allowable value for the alternate part of the format. When provided, it must be at least one digit, and the same length as, but not less than si_altMin
(which must also be provided).SIFmt(s_msgTxtPostfix, si_rqdMin, si_rqdMax, si_altMin, si_altMax)
si_fmt
.pb_isFmtEq()
Is the provided SIFmt
's format equal to this SIFmt
's format?
si_fmt
: The SIFmt
whose format should be compared to the format of this SIFmt
. REQUIRED(si_fmt.siRqMn == this.siRqMn &&
si_fmt.siRqMx == this.siRqMx &&
si_fmt.siLtMn == this.siLtMn &&
si_fmt.siLtMx == this.siLtMx)
pb_isFmtEq(si_fmt)
si_fmt
.gtDgts()
Get the provided string after eliminating all non-digits.
s_tring
: The value to string numbers from. REQUIREDs_tring
equals
(215) 555-1212
',
2155551212
'
''
: when s_tring
contains no digits. Note that decimal points ('.') and negative signs (dashes, '-') are eliminated.gtDgts(s_tring)
si_fmt
.pb_gtFmtV()
When valid for this format, get the digits from value string.
s_value
: The value to analyze for format-conformity. REQUIREDs_value
is legal according to this format, then it is returned with all non-digits eliminated. For example, (215) 555-1212
, if valid, is returned as 2155551212
.undefined
: when the value is not legal for this format.pb_gtFmtV(s_value)
___RPLC___ vfjs_doc_footer ___RPLCZ___