Skip to content

Commit 604d808

Browse files
committed
Fixed bug in toggleDisabled victorjonsson#437
1 parent dd4119e commit 604d808

35 files changed

+47
-49
lines changed

form-validator/brazil.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/date.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/file.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/html5.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/jquery.form-validator.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/** File generated by Grunt -- do not modify
1818
* JQUERY-FORM-VALIDATOR
1919
*
20-
* @version 2.3.18
20+
* @version 2.3.19
2121
* @website http://formvalidator.net/
2222
* @author Victor Jonsson, http://victorjonsson.se
2323
* @license MIT
@@ -675,13 +675,11 @@
675675
'submit'
676676
);
677677

678-
if (result.shouldChangeDisplay) {
679-
if (!result.isValid) {
680-
addErrorMessage(result.errorMsg, $elem);
681-
} else if (result.isValid) {
682-
$elem.valAttr('current-error', false);
683-
$.formUtils.dialogs.applyInputSuccessStyling($elem, conf);
684-
}
678+
if (!result.isValid) {
679+
addErrorMessage(result.errorMsg, $elem);
680+
} else if (result.isValid && result.shouldChangeDisplay) {
681+
$elem.valAttr('current-error', false);
682+
$.formUtils.dialogs.applyInputSuccessStyling($elem, conf);
685683
}
686684
}
687685

@@ -1217,6 +1215,7 @@
12171215
})
12181216
.trigger('beforeValidation', [value, conf, language]);
12191217

1218+
12201219
var inputIsOptional = $elem.valAttr('optional') === 'true',
12211220
skipBecauseItsEmpty = !value && inputIsOptional,
12221221
validationRules = $elem.attr(conf.validationRuleAttribute),

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/jsconf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** File generated by Grunt -- do not modify
22
* JQUERY-FORM-VALIDATOR
33
*
4-
* @version 2.3.18
4+
* @version 2.3.19
55
* @website http://formvalidator.net/
66
* @author Victor Jonsson, http://victorjonsson.se
77
* @license MIT

form-validator/lang/ca.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/lang/cz.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/lang/de.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/lang/dk.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/lang/es.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/lang/fr.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/lang/it.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/lang/nl.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/lang/no.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/lang/pl.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/lang/pt.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/lang/ro.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/lang/ru.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/lang/sv.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/location.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/logic.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/poland.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/sanitize.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/security.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/sepa.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/sweden.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/toggleDisabled.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/uk.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

formvalidator.jquery.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"validation",
88
"validator"
99
],
10-
"version": "2.3.18",
10+
"version": "2.3.19",
1111
"author": {
1212
"name": "Victor Jonsson",
1313
"url": "http://victorjonsson.se",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "jquery-form-validator",
33
"description": "With this feature rich jQuery plugin it becomes easy to validate user input while keeping your HTML markup clean from javascript code. Even though this plugin has a wide range of validation functions it's designed to require as little bandwidth as possible. This is achieved by grouping together validation functions in \"modules\", making it possible for the programmer to load only those functions that's needed to validate a particular form.",
4-
"version": "2.3.18",
4+
"version": "2.3.19",
55
"main": "./form-validator/jquery.form-validator.min.js",
66
"keywords": [
77
"form",

src/main/jquery-plugins.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -355,13 +355,11 @@
355355
'submit'
356356
);
357357

358-
if (result.shouldChangeDisplay) {
359-
if (!result.isValid) {
360-
addErrorMessage(result.errorMsg, $elem);
361-
} else if (result.isValid) {
362-
$elem.valAttr('current-error', false);
363-
$.formUtils.dialogs.applyInputSuccessStyling($elem, conf);
364-
}
358+
if (!result.isValid) {
359+
addErrorMessage(result.errorMsg, $elem);
360+
} else if (result.isValid && result.shouldChangeDisplay) {
361+
$elem.valAttr('current-error', false);
362+
$.formUtils.dialogs.applyInputSuccessStyling($elem, conf);
365363
}
366364
}
367365

src/main/utils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
})
146146
.trigger('beforeValidation', [value, conf, language]);
147147

148+
148149
var inputIsOptional = $elem.valAttr('optional') === 'true',
149150
skipBecauseItsEmpty = !value && inputIsOptional,
150151
validationRules = $elem.attr(conf.validationRuleAttribute),

src/modules/toggleDisabled.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
if( !isCheckingIfFormValid ) {
5454
isCheckingIfFormValid = true;
5555
var $form = $(this).closest('form');
56-
if( valid && $form.isValid(conf, conf.language, false) ) {
56+
if( valid && $form.isValid(conf.language, conf, false) ) {
5757
toggleFormState($form, 'enabled');
5858
} else {
5959
toggleFormState($form, 'disabled');

0 commit comments

Comments
 (0)