You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* A whole bunch of validation functions have been added (see below)
43
-
* A modular design have been introduced, which means that some validation functions is default and others is part of a module
45
+
* A modular design have been introduced, which means that some validation functions is default and others is
46
+
part of a module.
44
47
* You no longer need to prefix the validation rules with "validate_"
45
48
46
49
47
-
### Default validators (no module needed)
48
-
***validate_url**
49
-
***validate_email**
50
-
***validate_domain** — *domain.com*
51
-
***validate_phone** — *atleast 7 digits only one hyphen and plus allowed*
52
-
***validate_float**
53
-
***validate_int**
54
-
***validate_date** — *yyyy-mm-dd (format can be customized, more information below)*
55
-
***validate_length** — *Validate that input length is in given range (length3-20)*
56
-
***validate_confirmation**
57
-
***validate_spamcheck**
58
-
***validate_ukvatnumber**
59
-
***validate_swesec** — *validate swedish social security number*
50
+
### Default validators and features (no module needed)
51
+
***url**
52
+
***email**
53
+
***domain** — *domain.com*
54
+
***number** — *float/negative/positive*
55
+
***date** — *yyyy-mm-dd (format can be customized, more information below)*
56
+
***length** — *min/max/range*
60
57
***required** — *no validation except that a value has to be given*
61
-
***validate_custom** — *Validate value against regexp (validate_custom regexp/^[a-z]{2} [0-9]{2}$/)
62
-
***validate_num_answers** — *Validate that a select element has the required number of selected options (validate_num_answers num5)*
58
+
***custom** — *Validate value against regexp
59
+
***num_answers** — *Validate that a select element has the required number of selected options (num_answers num5)*
60
+
* Show help information automatically when input is focused
61
+
* Validate given values immediately when input is blurred.
62
+
* Make validation dependent on another input of type checkbox being checked by adding attribute data-validation-if-checked="name of checkbox input"
63
+
* Make validation optional by adding attribute data-validation-optional="true" to the element. This means
64
+
that the validation defined in data-validation only will take place in case a value is given.
65
+
* Make validation dependent on another input of type checkbox being checked by adding attribute
66
+
data-validation-if-checked="name of checkbox input"
67
+
* Create input suggestions with ease, no jquery-ui needed
63
68
64
69
### Module: security
65
-
***validate_spamcheck**
66
-
***validate_confirmation**
67
-
***validate_strength** — *Validate the strength of a password (validate_strength strength3)*
68
-
***validate_backend** — *Validate value of input on backend*
70
+
***spamcheck**
71
+
***confirmation**
72
+
***strength** — *Validate the strength of a password (strength strength3)*
73
+
***backend** — *Validate value of input on backend*
69
74
70
75
### Module: date
71
-
***validate_time** — *hh:mm*
72
-
***validate_birthdate** — *yyyy-mm-dd, not allowing dates in the future or dates that's older than 122 years (format can be customized, more information below)*
76
+
***time** — *hh:mm*
77
+
***birthdate** — *yyyy-mm-dd, not allowing dates in the future or dates that's older than 122 years (format can be customized, more information below)*
73
78
74
79
### Module: location
75
-
***validate_country**
76
-
***validate_federatestate**
77
-
***validate_longlat**
80
+
***country**
81
+
***federatestate**
82
+
***longlat**
78
83
* Suggest countries (english only)
79
84
* Suggest states in the US
80
85
81
86
### Module: sweden
82
-
***validate_swemob** — *validate that the value is a swedish mobile telephone number*
83
-
***validate_swesec** — *validate swedish social security number*
84
-
***validate_county** - *validate that the value is an existing county in Sweden*
85
-
***validate_municipality** - *validate that the value is an existing municipality in Sweden*
87
+
***swemob** — *validate that the value is a swedish mobile telephone number*
88
+
***swesec** — *validate swedish social security number*
89
+
***county** - *validate that the value is an existing county in Sweden*
90
+
***municipality** - *validate that the value is an existing municipality in Sweden*
86
91
* Suggest county
87
92
* Suggest municipality
88
93
89
94
### Module: ukvat
90
-
***validate_ukvatnumber**
91
-
92
-
### Misc (part of core)
93
-
* Show help information automatically when input is focused
94
-
* Validate given values immediately when input is blurred.
95
-
* Make validation dependent on another input of type checkbox being checked by adding attribute data-validation-if-checked="name of checkbox input"
96
-
* Make validation optional by adding attribute data-validation-optional="true" to the element. This means
97
-
that the validation defined in data-validation only will take place in case a value is given.
98
-
* Make validation dependent on another input of type checkbox being checked by adding attribute
99
-
data-validation-if-checked="name of checkbox input"
100
-
* Create input suggestions with ease, no jquery-ui needed
95
+
***ukvatnumber**
101
96
102
97
103
98
## Writing a custom validator
@@ -111,11 +106,11 @@ that checks if the input contains an even number.
0 commit comments