var cfgAllForms = new ConfigAllForms();
wrtConceptTop("sif",
"Ensures string values are validly-formatted 'string-integers', such as phone numbers, zip codes and Social Security Numbers.",
undefined,
'trm rqd len dec eml int SIF mcr bss');
var da_sMt = new DocAttr(a2c_sMt,
sSMSG_PPRE + " value is not valid according to your SIFmt
-Attribute configuration.",
sSMSG_RLS + '
Note there are special restrictions on SIFmt
-s when the text
/password
element has MAXLENGTH
associated to it.');
wrtAttributeTable("sif", da_sMt);
function printSIFTable() {
wrt('
');
wrt('sMTPost | ');
wrt('siRqMn | ');
wrt('siRqMx | ');
wrt('siLtMn | ');
wrt('siLtMx | ');
for(var i = 13; i < aCMPTBL_ATTRS.length; i++) {
wrt('
');
wrt(' ' + aCMPTBL_ATTRS[i].sif.sMTPost + ' | ');
wrt(' ' + aCMPTBL_ATTRS[i].sif.siRqMn + ' | ');
wrt(' ' + aCMPTBL_ATTRS[i].sif.siRqMx + ' | ');
var siAltMin = aCMPTBL_ATTRS[i].sif.siLtMn;
if(!df(siAltMin)) {
siAltMin = " ";
}
wrt(' ' + siAltMin + ' | ');
var siAltMax = aCMPTBL_ATTRS[i].sif.siLtMx;
if(!df(siAltMax)) {
siAltMax = " ";
}
wrt(' ' + siAltMax + ' | ');
}
wrt('
');
}
function wrtSifCCDdb(s_formPost, s_lmnt, b_useRqd) {
var clatfRqd;
if(b_useRqd) {
var sMsgRqd = "The SIFmt \\'sMsgTxt*\\' value is requried.";
if(s_formPost == "pwd") {
sMsgRqd = "The *secret* SIFmt \\'sMsgTxt*\\' value (shhhh) is requried.";
}
clatfRqd = new CLATrueFalse("sMsgRequired", undefined, undefined, sMsgRqd, undefined, false);
}
var asSifAttrs = [];
var asWhenSlctd = [];
var asDispDdb = [];
for(var i = 13; i < aCMPTBL_ATTRS.length; i++) {
asSifAttrs[asSifAttrs.length] = "sMsgTxt" + aCMPTBL_ATTRS[i].sif.sMTPost;
if(s_lmnt.indexOf("secret") != -1) {
asWhenSlctd[asWhenSlctd.length] = "That is not a legally-formatted \\\'" + aCMPTBL_ATTRS[i].sif.sMTPost + "\\\'.";
} else {
asWhenSlctd[asWhenSlctd.length] = "The *secret* value (shhhhh) is not a legally-formatted \\\'" + aCMPTBL_ATTRS[i].sif.sMTPost + "\\\'.";
}
asDispDdb[asDispDdb.length] = aCMPTBL_ATTRS[i].sif.sMTPost
}
var claDdb = new CLAMultiAttrDdb(asSifAttrs, asWhenSlctd, 0, "sMsgTxt", asDispDdb, true);
var acla = [claDdb];
if(b_useRqd) {
acla[acla.length] = clatfRqd;
}
var cfgLmnt = new ConfigFrmObj(s_lmnt, acla, false);
var cfgFrm = new ConfigForm("my_form_" + s_formPost, [cfgLmnt]);
cfgAllForms.addConfigForm(cfgFrm);
if(b_useRqd) {
clatfRqd.wrtCLATrueFalse();
}
claDdb.wrtCLAMultiAttrDdb();
}
function lrtSifDdb(s_type, s_extra) {
var sLrt = "Demo testing values, both legal and illegal, designed for 'sMsgTxt" + s_type + "'.";
if(df(s_extra)) {
sLrt += "\n\n" + s_extra;
}
alert(sLrt);
}