<<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
Object Type:  text

Compatible Concepts rqd dec eml int len mcr bss trm sif
Compatible Attributes sMsgRequired,  sMsgTxtDec,  sMsgTxtEmail,  sMsgTxtInt,  sMsgBadLength,  bsNoBadSubStrs,  asBadSubStrs,  sMsgBadSubStr,  bsDontTrimSpaces,  bsTrimSpaces,  sMsgTxtZip5,  sMsgTxtZip5p4,  sMsgTxtPhone7,  sMsgTxtPhone10,  sMsgTxtSsn
Example Associationf_orm.your_string.sVFAttribute = 'String value';
Example Object<INPUT TYPE="text" NAME="your_string">
   ...OR...
<INPUT TYPE="text" NAME="your_string" MAXLENGTH="20">
Object RulesEvery text element in the form must have a unique name.

MAXLENGTH

Both text and password elements have the standard HTML (and optional) MAXLENGTH attribute available to them.

Regarding sMsgBadLength: When MAXLENGTH is associated to the element, both iMinLength and iMaxLength must be less-than-or-equal than it. See the interactive example.

Regarding SIFmt-Attributes (sMsgTxt*): When MAXLENGTH is associated to the element, it must be greater-than-or-equal-to the 'required' part of the SIFmt (the si_rqdMin constructor parameter). See the interactive example.

When not explicitely associated to a (text or password) element, MAXLENGTH is always either -1, or a legal int; never undefined. '-1' means either 'not provided' or 'was provided as an illegal value', and is therefore treated as if it were never provided. For example, setting MAXLENGTH to "bla" in the form, it is changed to -1 before validate_form.js processes it.

Internet Explorer exception: When not explicitly set by you, Internet Explorer (version 6 at least) sets MAXLENGTH to 2147483647. Any higher number is too high (illegal), and reverted to -1. When MAXLENGTH equals this special value, it is not displayed in the validate_form.js debugging output.

MAXLENGTH is actually represented in memory by 'maxLength'.








































SourceForge.net Logo

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