Jel. FormValidator

Provides unobtrusive client-side validation behaviour to an HTML form, via recognition of special CSS class strings (validation classes) attached to each field.  Includes customisation options for how to display the validation errors (results), how to change the display of “culprit” fields and their labels (through css classes) and also the option to display these errors adjacent to each field in “inline” containers (on field blur).  Error messages are automatically generated through use of internationalizable error template strings, but can also be entirely customized if the automatic messages are insufficient.  See below for terminology used within this documentation.

Terminology

culpritA culprit field is a field that has been deemed not valid when validating the form it belongs to.
resultsThe results of the form validation refers to the information gathered about the culprits during that validation (if any, that is, if validation fails).  Displaying the results usually refers to displaying the error messages that describe what is wrong with each culprit field to the person filling in the form.
validation classthe special CSS classes that are applied to form elements which describe rules for them to be valid.  Many pretermined classes are available to use, or you can define your own custom validation classes (functions) and associated error templates (see below).
error templatea string template resource linked to each validation class that defines the error message to show when that validation rule fails.  For custom validation classes, an equivalent error template needs to be defined also.
error messagethe message for each culprit field describing why validation has failed.  (this is the “filled-in” version of the error template for the validation class rule that has not been satisifed).
inline validationif activated, individual fields will be validated on blur.  If this validation fails, an inline error message (a variation of the standard error message, without the field label) will be placed inside the associated inline (see below)
inlinean optional container element defined for each field (typically adjacent to it in the DOM) that will be filled with any inline error messages generated during inline validation.

Validation Classes

The validation classes recognised by Jel.FormValidator are specified in the class attribute of each field in the form being validated.  The range of supported classes is quite extensive and automate validation of many conditions that you previously would have written custom code for.  Not only that, but all of the validation classes are able to build readable error messages that describe what went wrong to the user.  They can be be placed into 4 major categories:

requiredthe special case of a field simply being required
length basedchecks the character length of a field against a specified value, or lower and upper values
value basedchecks the value of a field against a specified comparison value, or upper and lower value, or even another field value
pattern basedspecial cases such as email addresses

It’s also important to note that most of these validation classes are derived from the function names in the Jel.Validator class, and they call out to those functions to check fields.

The “required” validation class

To mark a form field as being required (that is, a value must be provided to be able to submit the form), simply add the class “required” to the class attribute of the field.

Length-based validation classes

Length based classes check that a field in the form matches a certain character length condition.  These follow the format length-OPERATOR-COMPARE where:

OPERATORis the comparison operator being performed (see below)
COMPAREthe comparison length value, or lower and upper value if OPERATOR is “range”

Values for OPERATOR

eqequality comparison (==)
neqinequality comparison (!=)
ltless than (<)
gtgreater than (>)
leless than or equal to (<=)
gegreater than or equal to (>=)
rangebetween lower and upper bound (in a...b)

Values for COMPARE

awhere a is an integer, if OPERATOR is not “range”
a:bwhere a and b are integers representing lower and upper bounds if OPERATOR is range, and you want the bounds to be non-inclusive
a::bas above if OPERATOR is range, and you want the bounds to be inclusive

Examples of length-based validation classes

length-gt-5 - field length must be greater than (gt) 5 characters
length-eq-5 - field length must be equal to (eq) 5 characters
length-range-5:10 - field length must be between 5 and 10 characters, non-inclusive (:)
length-range-5::10 - field length must be between 5 and 10 characters, inclusive (::)

Value-based classes

Value-based classes check a field’s data type and value compared to another value, or lower and upper values if the operator is a range.  These values can either be constant, or can specified as the values of other fields in the form.  These follow the format [TYPE-]OPERATOR-COMPARE-FORMAT where:

TYPEis the data type that is expected in this field.
OPERATORis the comparison operator being performed.
COMPAREis the value, upper and lower value, or even another field to be compared
FORMATis the date format when TYPE is “date” or “time”

Refer to the reference below for possible values of each of these attributes.

Values for TYPE

empty (not specified)for strings, that is, no type check really occurs at all
intfor integers
floatfor floating point numbers, that is, they have decimals
numericfor int or float
datefor date strings.  When specifying a date, the FORMAT must also be specified
timesynonym for “date”.  This is more readable when you’re using a time format

Values for OPERATOR

The same as for length-based classes, with the extra exceptions:

(int|float|numeric)-positivea positive number
(int|float|numeric)-negativea negative number
date-future-FORMATa date string in the future in FORMAT
date-past-FORMATa date in the past in FORMAT
time-earlier-FORMATa time earlier than the current time time-later-FORMAT- a time later than the current time

Values for COMPARE (comparing constants)

The syntax for COMPARE follows the same rules as for length-based comparisons, but for different types, that is:

awhere a is an appropriate type (see below), for a single value comparison
a:bwhere a, b are an appropriate type (see below), for “range” lower and upper bounds (non-inclusive)
a::bwhere a, b are an appropriate type (see below), for “range” lower and upper bounds (inclusive)

Types are represented like so

TYPE is empty (string)whatever string you want to compare
TYPE is intan integer
TYPE is floatan integer, followed by lowercase “p” (for point), then another integer for decimal part.  E.g.  3p14159
TYPE is datea representation of a date in the format yyyymmdd (e.g.  20070403) for just a date, and yyyymmddThhmmss for date AND time.  (e.g.  20070403T133000)
TYPE is timea representation of a time in the format hhmmss (e.g.  133000)

Values for COMPARE (when comparing other fields)

If you want to compare the value of the field with another one in the same form, simply substitute the constant in the class string with the ID of the field(s) to compare, followed by the suffix in the “suffixCompareField” in Options hash of the constructor (by default this is “-field”).

Values for FORMAT (only appropriate for “date” and “time” types)

a dash-delimited version of a property identifier for the formatting constants in Jel.Date.FORMAT.  E.g. date-future-uk (Jel.Date.FORMAT.UK), date-future-uk-12 (Jel.Date.FORMAT.UK_12)

Examples of value-based validation classes

int-ge-4                             - integer greater than or equal to 4
int-range-4:8 - integer between 4 and 8, non-inclusive
float-range-4p5:20p1 - floating point, between 4.5 and 20.1
neq-password - not equal to "password" case-sensitive
eq-password-field - equal to the value of the field with ID "password" (useful for confirm password)
gt-ci-a - greater than "a", case-insensitive
lt-b - less than "b", case-sensitive
date-future-uk - UK formatted date (dd/mm/yyyy) in the future
date-ge-20000101-us - US formatted date (mm/dd/yyyy) sometime after the turn of the millenium (1st Jan 2000)
date-range-uk-20050201::20070301 - UK formatted date between 1st Feb 2005 and 1st Mar 2007, inclusive

Hopefully it’s clear from the rules above that they are a lot easier to construct than they are to explain!

Summary
Provides unobtrusive client-side validation behaviour to an HTML form, via recognition of special CSS class strings (validation classes) attached to each field.
The HTML form associated with this validator.
A hash of field labels (the text, not the label elements themselves) indexed by the ID of the related control.
Class constructor.
Registers a custom error message and custom inline error message for a given fieldId, and className (validation class).
Prevents the specified fields from being regarded in form validation.
Causes the specified fields to be regarded in form validation once again.
Prevents the fields with the specified name from being regarded in form validation.
Causes fields with the specified name to be regarded in form validation once again.
Registers the specified fields to be validated by the form validator.
Removes the specified fields from the form validator.
displays a given field as a validation culprit.
displays a given field as being valid, that is, NOT a validation culprit.
displays an inline element for a validation culprit.
hides an inline element for a field that is likely no longer a validation culprit.
checks if a given field is currently classed as a culprit (via CSS)
Marks the given field as a culprit field in the validation results.
Attempts to submit the form associated with this validator, by running all validation, and submitting if successful.
Validates the form associated with this validator, and sets up validation results.
Displays all of the current culprit fields for the latest validation.
Shows all of the form fields as non-culprit.
Displays the results of the validation, based on options specified in the constructor method.
Hides the results of the validation, and also any inlines associated with previous validations (if visible).
The method called to display the validation results as a JavaScript alert, if the options specify this (see constructor for more).
The method called to display the validation results inside a DOM container (controlled via the resultsContainer option in constructor).
The method called to hide the DOM container that validation results are displayed in (controlled via the resultsContainer option in constructor).
The default method for formatting a field label when displaying them in validation error messages or inline error messages.
The default method for formatting date format strings when displaying them in validation error messages or inline error messages.
Validates a single given field in the form associated with this validator, and sets up the results for just this field.
Checks if a given field is valid within the form associated with this validator.
Checks if a given field is “empty” within the form.  For textareas and text inputs, this is when the field value is the empty string.
Gets the inline error message container for a given field.

Properties

form

The HTML form associated with this validator.

fieldLabels

A hash of field labels (the text, not the label elements themselves) indexed by the ID of the related control.

Functions

constructor

constructor: function(form,
options)

Class constructor.

Parameters

formHTML Form Element, the form to apply form validation behaviour to
optionshash, a hash of options to configure the validator (see below)

Options available (specified in options hash)

callbackshash, a collection of optional callbacks to customise the behaviour of the form validator (see below)
validatorsHash, a collection of custom validators to use for this form, indexed by the camelized class names that they match (for example, a “user-name” class would be indexed “userName” in this hash)
errorTemplatesHash, a collection of errorTemplates to use for any custom validators in validators (each validator requires an error template), indexed by the uppercase-underscore-delimited version of the class name (for example, a “user-name” class would be indexed “USER_NAME” in this hash)
culpritFieldClassNameString (default “culprit”), the class name to apply to fields that are responsible for the form not validating (termed ‘culprits’)
culpritLabelClassNameString (default “culprit”), the class name to apply to the labels of culprit fields
selectEmptyValueString (default “”), the value of a select field that is regarded as empty (that is, not yet chosen)
validateInlineBoolean (default true), indicates whether single field validation should occur on each field’s onblur event, and be displayed in associated “inline” elements
suffixCompareFieldString (default “-field”), the suffix used to describe field comparisons in validation classes
suffixInlineString (default “-inline”), the suffix added to a field ID to determine the ID of an “inline” container, used to display inline error messages for that field
resultsContainerHTML Element, if specified, the form validator will build an XHTML error message inside this container, which consists of an intro paragraph, followed by an unordered list of all error messages)
resultsAlertBoolean, if true the form validator will display a nicely formatted JavaScript alert box showing your errors.  This will also occur by default automatically if no other display has been specified, that is if both options.callbacks.onShowResults and options.resultsContainer are not specified.

Callbacks available (specified in options.callbacks hash)

formatFieldLabel(label, field)If specified, the string this function returns will be used as the field label when it is shown in error messages
formatDateFormat(format)If specified, the string this function returns will be used as a date format when they are shown in error messages
onShowResults(results, validator)If specified, will be called when displaying the results of a validation (only occurs is there are problems).  Refer to showResultsAlert for information on the results parameter.
onValidate(validator)If specified, this will be called after regular field validation has occurred, to allow you to perform any custom validation (return false if not the form is still not valid, true otherwise)
onSubmit(validator)If specified, this function will be called once all validation is successful, but before the form is submitted.  Return false to prevent form submission, and true to let it through.  Preventing form submission (returning false) could be an approach for AJAX applications that hijack a standard form submit.

Example

var validator = new Jel.FormValidator
(
$('contact-form'),
{
callbacks:
{
formatFieldLabel: function(label)
{
return '<em>' + label.replace(/[:\*]/g, '') + '</em>';
},

onSubmit: function(validator)
{
this.sendAjaxRequest(Form.serialize(validator.form));
return false;
}
}
}
);

registerErrorMessage

registerErrorMessage: function(fieldId,
className,
errorMessage,
errorInlineMessage)

Registers a custom error message and custom inline error message for a given fieldId, and className (validation class).  Note that this is not an error template, rather, it is the final error message that will be displayed.

Parameters

fieldIdString, the ID of the field
classNameString, the validation class to attach error messages to
errorMessageString, the error message to display when validation on the field fails for the validation rule described by className.
errorMessageString, the inline error message to display when validation fails.

Example

validator.registerErrorMessage(
$('username'),
"length-ge-6",
"Username must be at least 6 characters long",
"must be at least 6 characters long"
);

disableFields

disableFields: function()

Prevents the specified fields from being regarded in form validation.  This would be essential if you have elements that are hidden or disabled based on the values of other elements, since you wouldn’t want to display error messages for fields the user can’t see or edit.

Parameters

fieldId (variable)String(s), A variable amount of element IDs for fields you want disregarded in validation, or the element “name” attribute for radio buttons and checkboxes

Example

validator.disableFields("billing-address", "billing-state", "billing-post-code", "billing-city", "billing-country");
// suppose you had a checkbox labelled "use shipping address" which disabled billing address fields
// which you wanted to disregard in validation

See also: enableFields

enableFields

enableFields: function()

Causes the specified fields to be regarded in form validation once again.  This would be generally called for fields tat had been previously disabled by disableFieldsIMPORTANT: Don’t call this method if you are adding new fields to the form and want them regarded in validation.  Please use addFields instead for this purpose.

Parameters

fieldId (variable)String(s), A variable amount of element IDs for fields you want disregarded in validation, or the element “name” attribute for radio buttons and checkboxes

Example

validator.disableFields("billing-address", "billing-state", "billing-post-code", "billing-city", "billing-country");
// suppose you had a checkbox labelled "use shipping address" which disabled billing address fields
// which you wanted to disregard in validation

See also: disableFields

disableFieldByName

disableFieldByName: function(name)

Prevents the fields with the specified name from being regarded in form validation.  This should only be used for radio buttons and checkboxes.

Parameters

nameString, the “name” attribute for radio buttons and checkboxes you want disabled (that is, to be ignored in validation).

Example

validator.disableFieldByName("interests");

See also: disableFields, enableFieldByName

enableFieldByName

enableFieldByName: function(name)

Causes fields with the specified name to be regarded in form validation once again.  This should only be used for radio buttons and checkboxes.

Parameters

nameString, the “name” attribute for radio buttons and checkboxes you want enabled.

Example

validator.disableFieldByName("interests");

See also: disableFieldByName, enableFields

addFields

addFields: function()

Registers the specified fields to be validated by the form validator.  This call is ESSENTIAL for fields that are added as the user interacts with the page, and it should be called after fields have been added inside the form tag for this validator.  See below for why this is not handled automatically.

Parameters

element (variable)Element(s), a variable number of fields to add to the validator

Reason for this method

For performance reasons, the form validator analyses the fields inside its associated form only when the class is constructed, where it builds quickly accessible information it can use for subsequent validations.  It does not check for new fields in the form each time the form is validated, so you need to call this method if any new fields are added to the form.

Example

new Insertion.Top($("extra-credentials"), "<label for="alternate-username">Alternate Username:</label>" +
"<input id="alternate-username" anme="alternate-username" class="length-ge-7" />" +
"<div id="alternate-username-inline" class="inline"></div>");

validator.addFields($("alternate-username"));

See also: removeFields

removeFields

removeFields: function()

Removes the specified fields from the form validator.  This call is ESSENTIAL for fields that are removed as the user interacts with the page, and it should be called before fields have been removed from the form.  See addFields for a discussion of why this is not handled automatically.

Parameters

element (variable)Element(s), a variable number of fields to remove from the validator

Example

validator.removeFields($('alternate-username'));
$("extra-credentials").innerHTML = ""; // assuming "extra-credentials" had "alternate-username" control inside it.

displayCulprit

displayCulprit: function(field,
isInline)

displays a given field as a validation culprit.  While this method is best utilised internally by this class, it can be overridden to provide more sophisticated behaviour if so desired.

Parameters

fieldElement, the field to display as a culprit
isInlinewhen called by this class, indicates whether this culprit display is occurring for inline validation (on field blur)

Example

validator.displayCulprit($('username'), true);

See also: releaseCulprit, displayInline

releaseCulprit

releaseCulprit: function(field)

displays a given field as being valid, that is, NOT a validation culprit.  While this method is best utilised internally by this class, it can be overridden to provide more sophisticated behaviour if so desired.

Parameters

fieldElement, the field to display as a non-culprit
isInlinewhen called by this class, indicates whether this non-culprit display is occurring for inline validation (on field blur)

Example

validator.releaseCulprit($('username'), true);

See also: displayCulprit, releaseInline

displayInline

displayInline: function(inline,
message)

displays an inline element for a validation culprit.  While this method is usually best utilised internally by this class, it can also be overridden to provide more sophisticated behaviour if so desired.

Parameters

inlineElement, the inline element to display, for a culprit field
messageString, the inline error message being displayed

Example

validator.displayInline($('username-inline'), "username already in use");

See also: displayCulprit, releaseInline

releaseInline

releaseInline: function(inline)

hides an inline element for a field that is likely no longer a validation culprit.  While this method is usually best utilised internally by this class, it can also be overridden to provide more sophisticated behaviour if so desired.

Parameters

inlineElement, the inline element to hide, for a non-culprit field

Example

validator.releaseInline($('username-inline'));

See also: displayInline, releaseCulprit

classedCulprit

classedCulprit: function(field)

checks if a given field is currently classed as a culprit (via CSS)

Parameters

fieldElement, the field to check

addCulprit

addCulprit: function(field,
errorMessage,
errorInlineMessage)

Marks the given field as a culprit field in the validation results.  This would be most useful in the onValidate callback (see options for constructor) to add a field as a culprit before results are displayed.  This would generally be based on it failing some complex condition that can’t be described simply by validation classes on the field.  Note that this does not display the fields as a culprit, it just registers it in the validation results.

Parameters

fieldElement, the field to register as a culprit
errorMessageString, the standard error message to associate with the culprit field in the results
errorInlineMessageString, the inline error message to associate with the culprit field in the results

Example

if (parseInt($('percentage-male') + parseInt($('percentage-female'))) != 100)
validator.addCulprit($('percentage-male'), "Percentage Male and Female must total to 100 percent", "Must total to 100 percent");

submit

submit: function()

Attempts to submit the form associated with this validator, by running all validation, and submitting if successful.  Note that you would only need to use this if you have not provided a proper submit button, or input type=”image” button, which is not recommended, since it may be inaccessible.  If you have provided a submit or image, the validation will be automatically occur during the onsubmit event for the form.

Example

validator.submit();

validate

validate: function()

Validates the form associated with this validator, and sets up validation results.  Returns a boolean indicating if the validation as successful or not.  Generally, you won’t need to call this method directly.

displayCulprits

displayCulprits: function()

Displays all of the current culprit fields for the latest validation.  This is called automatically after validation occurs if any culprits are present.

releaseCulprits

releaseCulprits: function()

Shows all of the form fields as non-culprit.  This is called automatically before validation to clear any previous validation state.

showResults

showResults: function(results)

Displays the results of the validation, based on options specified in the constructor method.  This is called automatically on form submit.

Parameters

resultsHash, a hash containing a number of properties that describe the results of validation.  See below for more details.

Results Hash

culpritsArray, an array of the culprit fields, that is those that have caused the validation to fail
errorsArray, an array of error messages.  This is useful if you want to “split” the error messages without needing to know what fields they belong to
errorsByIdHash, an object hash of error messages, indexed by their corresponding culprit field ID.
inlinesArray, an array of the inline error messages.  The inline messages are generally the same as the standard error messages, but without reference to the field itself, since they are intended to be displayed adjacent to the field.
inlinesByIdHash, an object hash of the inline error messages, indexed by their corresponding culprit field ID.

See also: hideResults, showResultsAlert, showResultsList

hideResults

hideResults: function(results)

Hides the results of the validation, and also any inlines associated with previous validations (if visible).  This is called automatically just before form submit if the form is valid.

Parameters

resultsHash, a hash containing a number of properties that describe the results of validation.  See the reference under showResults for details.

See also: showResults, hideResultsList

showResultsAlert

showResultsAlert: function(results)

The method called to display the validation results as a JavaScript alert, if the options specify this (see constructor for more).  This could be overridden to provide more specific functionality.

Parameters

resultsHash, a hash containing a number of properties that describe the results of validation.  See the reference under showResults for details.

See also: showResults, showResultsList

showResultsList

showResultsList: function(results,
container)

The method called to display the validation results inside a DOM container (controlled via the resultsContainer option in constructor).  The default behaviour is to display an intro paragraph, which is in the language string Jel.Lang.FormValidator.ERRORS_TITLE, followed by an unordered list.  This could be overridden to provide more specific functionality.

Parameters

resultsHash, a hash containing a number of properties that describe the results of validation.  See the reference under showResults for details.
containerElement, the container to show results in

See also: showResults, showResultsAlert, hideResultsList

hideResultsList

hideResultsList: function(results,
container)

The method called to hide the DOM container that validation results are displayed in (controlled via the resultsContainer option in constructor).

Parameters

resultsHash, a hash containing a number of properties that describe the results of validation.  See the reference under showResults for details.
containerElement, the container to hide

See also: showResults, showResultsAlert, showResultsList

formatFieldLabel

formatFieldLabel: function(text,
field)

The default method for formatting a field label when displaying them in validation error messages or inline error messages.  This can be overridden by specifying the formatFieldLabel callback in constructor options, or you may wish to override this default method for a custom class derived from FormValidator.

Parameters

textString, the text for the field label (usually the innerHTML of its associated <label> element)
fieldElement, the field being displayed

formatDateFormat

formatDateFormat: function(format)

The default method for formatting date format strings when displaying them in validation error messages or inline error messages.  This can be overridden by specifying the formatDateFormat callback in constructor options, or you may wish to override this default method for a custom class derived from FormValidator.

Parameters

formatString, the date format string.  These are usually one of the properties in the Jel.Date.HUMAN_FORMAT hash, that is, a date format string as understood by humans.

validateField

validateField: function(field)

Validates a single given field in the form associated with this validator, and sets up the results for just this field.  This is called by the on blur event for the field if inline validation is setup

Parameters

fieldElement, the field to validate

Returns

trueif the field is valid
falseotherwise

Example

validator.validateField($('username'));

checkField

checkField: function(field,
compareOnly)

Checks if a given field is valid within the form associated with this validator.  This is called for each field in the form when attempting to submit.

Parameters

fieldElement, the field to validate
compareOnlyBoolean, whether the check is simply for comparison which doesn’t generate errors, and is mainly used for comparing two fields with each other.

Returns

trueif the field is valid
falseotherwise

Example

validator.checkField($('username'));

isFieldEmpty

isFieldEmpty: function(field)

Checks if a given field is “empty” within the form.  For textareas and text inputs, this is when the field value is the empty string.  For checkboxes and radios, a field is empty if all of the fields with the same name are unchecked.  A select is empty if its value is equal to options.selectEmptyValue (see constructor).  This is generally the first check done when a field has the validation class “required”.

Parameters

fieldElement, the field to check for emptiness

getInline

getInline: function(field)

Gets the inline error message container for a given field.

Parameters

fieldElement, the field to get an inline container for
constructor: function(form,
options)
Class constructor.
registerErrorMessage: function(fieldId,
className,
errorMessage,
errorInlineMessage)
Registers a custom error message and custom inline error message for a given fieldId, and className (validation class).
disableFields: function()
Prevents the specified fields from being regarded in form validation.
enableFields: function()
Causes the specified fields to be regarded in form validation once again.
disableFieldByName: function(name)
Prevents the fields with the specified name from being regarded in form validation.
enableFieldByName: function(name)
Causes fields with the specified name to be regarded in form validation once again.
addFields: function()
Registers the specified fields to be validated by the form validator.
removeFields: function()
Removes the specified fields from the form validator.
displayCulprit: function(field,
isInline)
displays a given field as a validation culprit.
releaseCulprit: function(field)
displays a given field as being valid, that is, NOT a validation culprit.
displayInline: function(inline,
message)
displays an inline element for a validation culprit.
releaseInline: function(inline)
hides an inline element for a field that is likely no longer a validation culprit.
classedCulprit: function(field)
checks if a given field is currently classed as a culprit (via CSS)
addCulprit: function(field,
errorMessage,
errorInlineMessage)
Marks the given field as a culprit field in the validation results.
submit: function()
Attempts to submit the form associated with this validator, by running all validation, and submitting if successful.
validate: function()
Validates the form associated with this validator, and sets up validation results.
displayCulprits: function()
Displays all of the current culprit fields for the latest validation.
releaseCulprits: function()
Shows all of the form fields as non-culprit.
showResults: function(results)
Displays the results of the validation, based on options specified in the constructor method.
hideResults: function(results)
Hides the results of the validation, and also any inlines associated with previous validations (if visible).
showResultsAlert: function(results)
The method called to display the validation results as a JavaScript alert, if the options specify this (see constructor for more).
showResultsList: function(results,
container)
The method called to display the validation results inside a DOM container (controlled via the resultsContainer option in constructor).
hideResultsList: function(results,
container)
The method called to hide the DOM container that validation results are displayed in (controlled via the resultsContainer option in constructor).
formatFieldLabel: function(text,
field)
The default method for formatting a field label when displaying them in validation error messages or inline error messages.
formatDateFormat: function(format)
The default method for formatting date format strings when displaying them in validation error messages or inline error messages.
validateField: function(field)
Validates a single given field in the form associated with this validator, and sets up the results for just this field.
checkField: function(field,
compareOnly)
Checks if a given field is valid within the form associated with this validator.
isFieldEmpty: function(field)
Checks if a given field is “empty” within the form.  For textareas and text inputs, this is when the field value is the empty string.
getInline: function(field)
Gets the inline error message container for a given field.
A collection of validation routines (also used by Jel.FormValidator)
a hash collection of common formatting string constants to be used with Jel.Date.format and Jel.Date.parse
The HTML form associated with this validator.
a hash collection of common date format string constants as usually expressed by humans, with each constant being equivalent to those in Jel.Date.FORMAT