|
4 | 4 | * Licensed under the MIT license |
5 | 5 | * |
6 | 6 | * @author Tom Bertrand |
7 | | - * @version 1.5.2 (2015-02-18) |
| 7 | + * @version 1.5.3 (2015-03-17) |
8 | 8 | * @link http://www.runningcoder.org/jqueryvalidation/ |
9 | 9 | * |
10 | 10 | * @note |
|
109 | 109 | button: "[type='submit']", |
110 | 110 | errorClass: "error", |
111 | 111 | errorListClass: "error-list", |
| 112 | + errorListContainer: null, |
112 | 113 | inputContainer: null, |
113 | 114 | clear: "focusin", |
114 | 115 | scrollToError: false |
|
433 | 434 |
|
434 | 435 | if (!validateForm()) { |
435 | 436 |
|
436 | | - // OnError function receives the "errors" object as the last "extraParam" |
437 | | - _executeCallback(options.submit.callback.onError, [node, errors]); |
438 | | - |
439 | 437 | displayErrors(); |
| 438 | + _executeCallback(options.submit.callback.onError, [node, errors]); |
440 | 439 |
|
441 | 440 | } else { |
442 | 441 |
|
|
469 | 468 | var isValid = true; |
470 | 469 |
|
471 | 470 | $.each( |
472 | | - node.find('[' + _data.validation + ']:not([disabled],[readonly]),[' + _data.regex + ']:not([disabled],[readonly])'), |
| 471 | + node.find('[' + _data.validation + ']:not([disabled]),[' + _data.regex + ']:not([disabled])'), |
473 | 472 | function (index, input) { |
474 | 473 | if (!validateInput(input)) { |
475 | 474 | isValid = false; |
|
820 | 819 | } |
821 | 820 |
|
822 | 821 | 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 | + } |
824 | 827 | } else if (options.submit.settings.display === 'block') { |
825 | 828 | errorContainer = node; |
826 | 829 | } |
|
0 commit comments