Skip to content

Commit 6a38f60

Browse files
author
tom bertrand
committed
1.5.3 RC1
- Added errorListContainer to allow flexible error list location inside the form dom tree - Corrected onError execution order for form submit
1 parent 3615802 commit 6a38f60

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "html5-form-validation",
3-
"version": "1.5.2",
3+
"version": "1.5.3",
44
"authors": [
55
"Tom Bertrand"
66
],

jquery.validation.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Licensed under the MIT license
55
*
66
* @author Tom Bertrand
7-
* @version 1.5.2 (2015-02-18)
7+
* @version 1.5.3 (2015-03-17)
88
* @link http://www.runningcoder.org/jqueryvalidation/
99
*
1010
* @note
@@ -109,6 +109,7 @@
109109
button: "[type='submit']",
110110
errorClass: "error",
111111
errorListClass: "error-list",
112+
errorListContainer: null,
112113
inputContainer: null,
113114
clear: "focusin",
114115
scrollToError: false
@@ -433,10 +434,8 @@
433434

434435
if (!validateForm()) {
435436

436-
// OnError function receives the "errors" object as the last "extraParam"
437-
_executeCallback(options.submit.callback.onError, [node, errors]);
438-
439437
displayErrors();
438+
_executeCallback(options.submit.callback.onError, [node, errors]);
440439

441440
} else {
442441

@@ -820,7 +819,11 @@
820819
}
821820

822821
if (options.submit.settings.display === 'inline') {
823-
errorContainer = errorContainer || input.parent();
822+
if (options.submit.settings.errorListContainer) {
823+
errorContainer = input.parentsUntil(node, options.submit.settings.errorListContainer);
824+
} else {
825+
errorContainer = errorContainer || input.parent();
826+
}
824827
} else if (options.submit.settings.display === 'block') {
825828
errorContainer = node;
826829
}

0 commit comments

Comments
 (0)