tmt.validator.validateFields(fields[], [callback]) allows to programmatically validate one or more fields
First argument is required. An array of fields. Array's elements can contain either an id (string) or a DOM node reference
Second argument is optional; it can be an error callback. If not specified, a plain JavaScript alert will be used
If a custom call back is specified, the validator will pass two arguments to it:
Please note the callback function gets invoked even if the fields don't contain errors. In this case the "validators" argument contains an empty array. This way it can reset error display and clean-up the GUI. This is especially important for forms that get submitted using Ajax, without refreshing the page.