Validatious 2.0

Easy form validation with unobtrusive JavaScript

Configuration settings

v2.Field.prototype.validateHidden

Decides if Validatious will validate a field when it is not visible. If this setting is true then fields will be validated even if it or one of it's parents are not visible.

  • Default value is false

v2.Field.prototype.instant

If true, then each field will be instantly validated whenever the user changes/enters/selects a value.

  • Default value is false

v2.Field.prototype.instantWhenValidated

If true, then each field will be instantly validated whenever the user changes/enters/selects a value, after the form has been validated once (ie by clicking the submit button).

  • Default value is true

v2.FieldValidator.prototype.invert

If true, all validators will be inverted, and thus will only pass when they are invalid. This setting is most useful for single instances in some cases where the inverse is needed.

  • Default value is false

v2.Validator.prefix

Sets a prefix for validator class names. By default there is no prefix, meaning that class="required" will resolve to the required validator. With a prefix of v2_, the previous example yields no validator, however class="v2_required" will.

  • Only available with the HTML extension
  • Default value is no prefix

v2.Form.autoValidateClass

The class name by which forms are selected for validation by the HTML extension.

  • Only available with the HTML extension
  • Default value is 'validate'

v2.Form.actionButtonClass

The class name by which buttons are selected to trigger validation by the HTML extension.

  • Only available with the HTML extension
  • Default value is 'action'

v2.html.validateAnyClass

The class name by which div and fieldset elements are selected for grouped validation where all validators are required to pass by the HTML extension.

  • Only available with the HTML extension
  • Default value is 'validate_any'

v2.html.validateAllClass

The class name by which div and fieldset elements are selected for grouped validation where only one validator is required to pass by the HTML extension.

  • Only available with the HTML extension
  • Default value is 'validate_all'

v2.Field.prototype.displayErrors

The number of errors to display per field.

  • Only available with the reporting extension
  • Default value is -1, ie all

v2.Field.prototype.displayErrorsAbove

If true, the errors list will be appended as the first element in the fields parent element. Otherwise it will be included last in the parent.

  • Only available with the reporting extension
  • Default value is true

v2.Field.prototype.failureClass

The class name that is appended to the fields parent element when the field fails validation.

  • Only available with the reporting extension
  • Default value is 'error'

v2.Field.prototype.successClass

The class name that is appended to the fields parent element when the field passes validation.

  • Only available with the reporting extension
  • Default value is '', ie no class is appended on success

v2.Field.prototype.messagesClass

The class name for the ul element that contains the error messages when validation fails.

  • Only available with the reporting extension
  • Default value is 'messages'

v2.Fieldset.prototype.displayErrors

The number of errors to display per fieldset.

  • Only available with the reporting extension
  • Default value is -1, ie all

v2.Fieldset.prototype.displayErrorsAbove

If true, the errors list will be appended as the first element in the fieldset/div element. Otherwise it will be included last child.

  • Only available with the reporting extension
  • Default value is true

v2.Fieldset.prototype.failureClass

The class name that is appended to the fieldset/div element when the collection fails validation.

  • Only available with the reporting extension
  • Default value is 'error'

v2.Fieldset.prototype.successClass

The class name that is appended to the fieldset/div element when the collection passes validation.

  • Only available with the reporting extension
  • Default value is '', ie no class is appended on success

v2.Fieldset.prototype.messagesClass

The class name for the ul element that contains the error messages when validation fails.

  • Only available with the reporting extension
  • Default value is 'messages'

v2.Form.prototype.scrollToFirstWhenFail

If true, then the page will scroll down to the first field that failed when a form is submitted with invalid fields.

  • Only available with the reporting extension
  • Default value is true

© 2008 Christian Johansen. Validatious is licensed with a BSD License, documentation and site content with CC Attribution-Share Alike. About.