<<BACK    HOME    CNCPT    TTRL    JSsf.net/projects/validateformjs[ U | s | m | ? ]
   rqd dec eml int len mcr bss trm SIFAll Concepts
   frm txt pwd txa rdo sl1 chk slmAll Object Types

validate_form.js
Concept: SIFmt-Attributes (sMsgTxt*)

Ensures string values are validly-formatted 'string-integers', such as phone numbers, zip codes and Social Security Numbers. Summary
sMsgTxtZip5,  sMsgTxtZip5p4,  sMsgTxtPhone7,  sMsgTxtPhone10,  sMsgTxtSsn All Attributes
txt pwd txa rdo sl1 chk slm Interactive Example Code
Higher  [  trm rqd len dec eml int SIF mcr bss  ]  Lower Precedence


[TOP]   SIFmt-Attributes (sMsgTxt*) attribute: sMsgTxt*        
Value Purpose The error message presented to the user when the value is not valid according to your SIFmt-Attribute configuration.
Value Rules Must be a string at least one character in length.

Note there are special restrictions on SIFmt-s when the text/password element has MAXLENGTH associated to it.

Object Compatibility text,  password
Attribute Compatibility sMsgRequired,  sMsgTxtDec,  sMsgTxtEmail,  sMsgTxtInt,  sMsgBadLength,  bsNoBadSubStrs,  asBadSubStrs,  sMsgBadSubStr,  bsDontTrimSpaces,  bsTrimSpaces



Understanding SIFmt-Attributes
  What Purpose/Description
GO  Tutorial: SIFmt Attributes Demonstrates how sif-attributes are implemented. Uses the default configuration.
GO  ../../../ si_fmt_CONFIGURATION.js The file containing your currently-and-actually-configured sif-attributes.

Here are your actually-and-currently configured sif-attributes, existing in ../../../si_fmt_CONFIGURATION.js:

sMTPost siRqMn siRqMx siLtMn siLtMx
Zip5 00001 99998    
Zip5p4 00001 99999 0001 9999
Phone7 1001000 9999999    
Phone10 1001001000 9999999999    
Ssn 000000001 999999999    
If there are no rows, then no sif-attributes are configured.

Note that the 'sMTPost' (the postfix applied after 'sMsgTxt'), as long as it contains only letters, digits and underscores, can equal anything but 'Dec', 'Email' or 'Int'.

It is recommended, although not required that your sif-attributes be configured in ../../../si_fmt_CONFIGURATION.js. You could name it something else, or put it in another directory. However, this documentation only recognizes this particular file name and location.

GO  si_fmt.js JavaScript class to defines and manage sif-attributes. If your formats are invalid for any reason, the constructor for this class is what will crash and inform you of that error.
   vf_stASIF.stASIF() Function that SIFmt configuration must be passed to, for validate_form.js to recognize it.
GO  ../../../secondary_js/ si_fmt_CONFIGURATION_default.js The configuration that originally existed in si_fmt_CONFIGURATION.js when you downloaded validate_form.js (do not touch this file). Consider this the 'default' configuration.

Here are the default sif-attribute configuration, existing in ../../../secondary_js/si_fmt_CONFIGURATION_default.js:

sMTPost siRqMn siRqMx siLtMn siLtMx
Zip5 00001 99999    
Zip5p4 00001 99999 0001 9999
Phone7 1001000 9999999    
Phone10 1001001000 9999999999    
Ssn 000000001 999999999    
GO Further Resources










TOP     rqd dec eml int len mcr bss trm SIF
<<BACK  TXT pwd txa rdo sl1 chk slm
Object Type Concept
text SIFmt-Attributes (sMsgTxt*)

VF-Config Snippet f_orm.your_sif_value.sMsgTxtZip5 = 'That is not a legally-formatted 'Zip5'.';
Example Element <INPUT TYPE="text" NAME="your_sif_value">

There is another example where MAXLENGTH is also associated to the element.

The form Change the vf-configuration
What is your SIFmt 'sMsgTxt*' value?
sMsgTxt
[[   DBG     ]]









BACK    SIFmt Attribute Example: A 'text' element with MAXLENGTH associated to it.

VF-Config Snippet f_orm.your_sif_value.sMsgTxtZip5 = 'That is not a legally-formatted 'Zip5'.
Example Element <INPUT TYPE="text" MAXLENGTH="9" NAME="your_sif_value">

It is recommended that MAXLENGTH not be associated to SIFmt elements. If it is, though, MAXLENGTH may not be greater than the SIFmt-s required part (the si_rqdMin constructor parameter). In this example, sMsgTxtPhone10 crashes because of a conflict with MAXLENGTH.

The form Change the vf-configuration
What is your SIFmt 'sMsgTxt*' value?
sMsgTxt
[[     [ CIBC CRSH ]   DBG     ]]



TOP     rqd dec eml int len mcr bss trm SIF
<<BACK  txt PWD txa rdo sl1 chk slm
Object Type Concept
password SIFmt-Attributes (sMsgTxt*)

VF-Config Snippet f_orm.secret_sif_value.sMsgTxtZip5 = 'The *secret* value (shhhhh) is not a legally-formatted 'Zip5'.';
Example Element <INPUT TYPE="password" NAME="secret_sif_value">

The form Change the vf-configuration
What is your secret (shhhhh) SIFmt 'sMsgTxt*' value?
sMsgTxt
[[   DBG     ]]








































SourceForge.net Logo

Copyright (C) 2003-2005, Jeff Epstein.   All rights reserved.