jQuery.Validate unobtrusive extensions
Exetnsions to the jquery.validate.unobtrusive library that prvides:
- Globalization support to both format verification, min, max, and range validation rules
- range, min, max are enhanced to work aith all inputs(number, date, time, datetime, weak, month).
- Enhancement of inputs with validation rules is applied easily to dynamically generated Html
- Format validation of positive integers, integers, floats, dates, datetimes, time, weeks, months, and colours.
- Dynamic range validation where the validated input value (number, date, time, datetime, weak, month) must fall inside a list of inputs defining minimum values and a list of inputs defining maximum values.
Points 1 and 2 relies on the mvcct.enhancer library and on the Globalize library. So please refers to the mvcct.enhancer documentation about how to apply validation also to dynamic Html. Please notice also that both the Globalize library and the mvcct.enhancer.basic.input optional module must be loaded and registred for this library to work properly.
This module has been designed to work with Asp.net core Mvc and with the Mvc Controls Tollkit Core version that fill autoamtically all validation data- attributes based on .Net property validation attributes. However, it can be used with any server technology if all needed data- attributes are somehow inserted in the input fields.
jquery-validation-unobtrusive-extensions is available both on bower and npm
All rules work both with Html5 inputs whose value format is international ISO, and falled back inputs working with current locale formats. The mvcct.enhancer fallback module takes care of not supported input fallback.
In order to have range, min, max support globalization and work with all types new validation rules have been defined,
Parameters names are:
max. Thus accordingly, associated attributes are
max must contain data in international iso format.
Rule name is: rdranger.
Parameters names are:
go. Thus, accordingly, associated attributes are
dmax are the space separated lists of the input names that define all minimum and maximum
dmaxds are the space separated lists of all margins between mins and maxs and the controlled value.
For instance if
dminds="2 4", then the controlled value must have a distance of
minInput1, and of
All dates/times related delays are expressed in milliseconds, and all numbers are expressed in international ISO format.
go is a parameter that if set to
data-drange-go='true'), instead of causing a validation error
let the controlled value be change to remain in the allowed range. This feature exploits the mvcct.enhancer dependency propagation module.
Correct type format rule.
Rule name is:
Unique parameter name is:
type. Thus, associated attribute is
type contains a number between
8 that encodes the type:
0 free format, 1 positive integer, 2 integer, 3 float, 4 time, 5 date, 6 datetime, 7 week, 8 month.