validation.js
Creates restricted input controls.
Functions
Constants
- Validation.TYPE_NUMERIC
- Validation.TYPE_LETTERS
- Validation.TYPE_DATE
Restricts input element. Restriction type is a constant, specified in type.
Params is an object, consisting of:
- min - minimum number of chars (for TYPE_NUMERIC and TYPE_LETTERS)
- max - maximum number of chars (for TYPE_NUMERIC and TYPE_LETTERS)
- def - default character (for TYPE_NUMERIC and TYPE_LETTERS)
- minDate - minimum allowed date (for TYPE_DATE), in form of [year, month, day], all indexed from 1
- maxDate - maximum allowed date (for TYPE_DATE), in form of [year, month, day], all indexed from 1
var i = Dom.create("input");
Validation.create(i, Validation.TYPE_LETTERS, {min:3, max:10, def:"_"}); // 3-10 chars, default '___'