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
+14-2Lines changed: 14 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,7 @@ This plugin was created to minimize javascript logic in the html code when deali
45
45
46
46
* Show help information automatically when input is focused
47
47
* Validate given values immediately when input is blurred.
48
+
* 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 referrs to.
48
49
49
50
50
51
## Validate inputs on blur
@@ -112,7 +113,12 @@ var myConf = {
112
113
113
114
// Window automatically scrolls to the top of the form when submitted data is
114
115
// invalid (default is true)
115
-
scrollToTopOnError :false
116
+
scrollToTopOnError :false,
117
+
118
+
// Name of the element attribute containing the error message that will be
119
+
// displayed instead of the error dialog that the validation function
120
+
// referrs to (default is data-validation-error-msg)
121
+
validationErrorMsgAttribute :'data-error'
116
122
};
117
123
118
124
var myLang = {
@@ -169,6 +175,8 @@ var jQueryFormLang = {
169
175
...
170
176
```
171
177
178
+
Inline validation is also possible. If you add attribute data-validation-error-msg to an element, the value of that attribute will
179
+
be displayed instead of the error dialog that the validation function referres to.
<strong>Date (optional)</strong><em>validate_date - This input will only be validated if it has a value</em><br/>
221
+
<inputtype="text" data-validation="validate_date" data-validation-optional="true" data-validation-error-msg="If you want to leave a date, it has to be correct" name="opt_date"/>
0 commit comments