Skip to content

Commit 3e30018

Browse files
committed
Callback onElementValidate does now always, both onblur and onsubmit (onBlurError therefor also removed) #210
1 parent 9a4391c commit 3e30018

File tree

9 files changed

+22
-24
lines changed

9 files changed

+22
-24
lines changed

form-validator/date.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @website http://formvalidator.net/#location-validators
1212
* @license Dual licensed under the MIT or GPL Version 2 licenses
13-
* @version 2.2.beta.48
13+
* @version 2.2.beta.49
1414
*/
1515
(function($) {
1616

form-validator/file.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @website http://formvalidator.net/
1212
* @license Dual licensed under the MIT or GPL Version 2 licenses
13-
* @version 2.2.beta.48
13+
* @version 2.2.beta.49
1414
*/
1515
(function($, window) {
1616

form-validator/html5.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* @website http://formvalidator.net/
1919
* @license Dual licensed under the MIT or GPL Version 2 licenses
20-
* @version 2.2.beta.48
20+
* @version 2.2.beta.49
2121
*/
2222
(function($, window) {
2323

form-validator/jquery.form-validator.js

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* @website http://formvalidator.net/
77
* @license Dual licensed under the MIT or GPL Version 2 licenses
8-
* @version 2.2.beta.48
8+
* @version 2.2.beta.49
99
*/
1010
(function($) {
1111

@@ -259,11 +259,6 @@
259259
_applyErrorStyle($elem, conf);
260260
_setInlineErrorMessage($elem, validation, conf, conf.errorMessagePosition);
261261

262-
// Run inline error callback
263-
if( typeof conf.onInlineError == 'function' ) {
264-
conf.onInlineError($elem, validation, conf);
265-
}
266-
267262
if(attachKeyupEvent) {
268263
$elem
269264
.unbind('keyup.validation')
@@ -397,11 +392,6 @@
397392
);
398393

399394
if(validation != null) {
400-
// Run element validation callback
401-
if( typeof conf.onElementValidate == 'function' ) {
402-
conf.onElementValidate((validation === true), $elem, $form, validation);
403-
}
404-
405395
if(validation !== true) {
406396
addErrorMessage(validation, $elem);
407397
} else {
@@ -563,7 +553,6 @@
563553
onSuccess : false,
564554
onError : false,
565555
onElementValidate : false,
566-
onInlineError : false
567556
});
568557

569558
conf = $.extend(defaultConf, conf || {});
@@ -947,15 +936,24 @@
947936

948937
}, ' ');
949938

939+
var result;
940+
950941
if( typeof validationErrorMsg == 'string' ) {
951942
$elem.trigger('validation', false);
952-
return validationErrorMsg;
943+
result = validationErrorMsg;
953944
} else if( validationErrorMsg === null && !conf.addValidClassOnAll ) {
954-
return null;
945+
result = null;
955946
} else {
956947
$elem.trigger('validation', true);
957-
return true;
948+
result = true;
949+
}
950+
951+
// Run element validation callback
952+
if( typeof conf.onElementValidate == 'function' && result !== null ) {
953+
conf.onElementValidate((result === true), $elem, $form, validation);
958954
}
955+
956+
return result;
959957
},
960958

961959
/**

form-validator/jquery.form-validator.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/location.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @website http://formvalidator.net/#location-validators
1212
* @license Dual licensed under the MIT or GPL Version 2 licenses
13-
* @version 2.2.beta.48
13+
* @version 2.2.beta.49
1414
*/
1515
(function($) {
1616

form-validator/security.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* - cvv
1414
*
1515
* @website http://formvalidator.net/#security-validators
16-
* @version 2.2.beta.48
16+
* @version 2.2.beta.49
1717
*/
1818
(function($, window) {
1919

form-validator/sweden.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
* @website http://formvalidator.net/#swedish-validators
1515
* @license Dual licensed under the MIT or GPL Version 2 licenses
16-
* @version 2.2.beta.48
16+
* @version 2.2.beta.49
1717
*/
1818
(function($, window) {
1919

form-validator/uk.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
* @website http://formvalidator.net/#uk-validators
1111
* @license Dual licensed under the MIT or GPL Version 2 licenses
12-
* @version 2.2.beta.48
12+
* @version 2.2.beta.49
1313
*/
1414
$.formUtils.addValidator({
1515
name : 'ukvatnumber',

0 commit comments

Comments
 (0)