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
Copy file name to clipboardExpand all lines: README.md
+19-9Lines changed: 19 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -39,13 +39,13 @@ particular form.
39
39
40
40
So what has changed since version 1.x?
41
41
42
-
* A whole bunch of validation functions have been added (see below)
42
+
* A whole bunch of validation functions have been added (see below).
43
43
* A modular design have been introduced, which means that some validation functions is default and others is
44
44
part of a module. This in turn reduces server and bandwidth costs.
45
-
* You no longer need to prefix the validation rules with "validate_"
46
-
* Error message position now defaults to "element"
47
-
* The optional features (validatOnBlur and showHelpOnFocus) is now enabled by default
48
-
* The function $.setForm is introduced that makes it possible to initiate the form validation with less code
45
+
* You no longer need to prefix the validation rules with "validate_".
46
+
* Error message position now defaults to "element".
47
+
* The optional features (validateOnBlur and showHelpOnFocus) is now enabled by default.
48
+
* The function $.setupForm(config) is introduced to reduce the amount of code that needs to be written when initiating the form validation.
49
49
50
50
51
51
### Default validators and features (no module needed)
@@ -58,7 +58,6 @@ So what has changed since version 1.x?
58
58
***length** — *min/max/range*
59
59
***required** — *no validation except that a value has to be given*
60
60
***custom** — *Validate value against regexp*
61
-
***num_answers** — *Validate that a select element has the required number of selected options (num_answers num5)*
62
61
* Show help information automatically when input is focused
63
62
* Validate given values immediately when input looses focus.
64
63
* Make validation dependent on another input of type checkbox being checked by adding attribute data-validation-if-checked="name of checkbox input"
@@ -68,23 +67,31 @@ So what has changed since version 1.x?
68
67
data-validation-if-checked="name of checkbox input"
69
68
* Create input suggestions with ease, no jquery-ui needed
70
69
70
+
Read the documentation for the [default features at http://formvalidator.net/##default-validators](http://formvalidator.net/#default-validators)
71
+
71
72
### Module: security
72
73
***spamcheck**
73
74
***confirmation**
74
75
***strength** — *Validate the strength of a password (strength strength3)*
75
76
***backend** — *Validate value of input on backend*
76
77
78
+
Read the documentation for the [security module at http://formvalidator.net/#default-validators](http://formvalidator.net/#security-validators)
79
+
77
80
### Module: date
78
81
***time** — *hh:mm*
79
82
***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)*
80
83
84
+
Read the documentation for the [date module at http://formvalidator.net/#default-validators](http://formvalidator.net/#date-validators)
85
+
81
86
### Module: location
82
87
***country**
83
88
***federatestate**
84
89
***longlat**
85
90
* Suggest countries (english only)
86
91
* Suggest states in the US
87
92
93
+
Read the documentation for the [location module at http://formvalidator.net/#default-validators](http://formvalidator.net/#location-validators)
94
+
88
95
### Module: sweden
89
96
***swemob** — *validate that the value is a swedish mobile telephone number*
90
97
***swesec** — *validate swedish social security number*
@@ -93,16 +100,20 @@ So what has changed since version 1.x?
93
100
* Suggest county
94
101
* Suggest municipality
95
102
96
-
### Module: ukvat
103
+
Read the documentation for the [Swedish module at http://formvalidator.net/#default-validators](http://formvalidator.net/#sweden-validators)
104
+
105
+
### Module: uk
97
106
***ukvatnumber**
98
107
108
+
Read the documentation for the [UK module at http://formvalidator.net/#default-validators](http://formvalidator.net/#uk-validators)
109
+
99
110
100
111
## Writing a custom validator
101
112
You can use the function `$.formUtils.addValidator()` to add your own validation function. Here's an example of a validator
Inline error messages is also possible. If you add attribute data-validation-error-msg to an element the value of that attribute will be displayed instead of the error dialog that the validation function refers to.
0 commit comments