Skip to content

Commit 7df724d

Browse files
committed
coerce null values to empty string victorjonsson#470
1 parent 6b00819 commit 7df724d

35 files changed

+74
-54
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: 3 additions & 9 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.26
20+
* @version 2.3.29
2121
* @website http://formvalidator.net/
2222
* @author Victor Jonsson, http://victorjonsson.se
2323
* @license MIT
@@ -498,8 +498,6 @@
498498
*/
499499
$.fn.validateInputOnBlur = function (language, conf, attachKeyupEvent, eventType) {
500500

501-
console.log('validating '+this.get(0).name+' on blur');
502-
503501
$.formUtils.eventType = eventType;
504502

505503
if ( this.willPostponeValidation() ) {
@@ -547,7 +545,6 @@
547545
}
548546

549547
if (!result.isValid && attachKeyupEvent) {
550-
console.log('in here');
551548
$elem.validateOnKeyUp(language, conf);
552549
}
553550

@@ -561,12 +558,9 @@
561558
this.each(function() {
562559
var $input = $(this);
563560
if (!$input.valAttr('has-keyup-event')) {
564-
console.log('Applygin keyup-validation on '+this.name);
565-
console.log((new Error()).stack);
566561
$input
567562
.valAttr('has-keyup-event', 'true')
568563
.bind('keyup.validation', function (evt) {
569-
console.log('key up');
570564
if( evt.keyCode !== 9 ) {
571565
$input.validateInputOnBlur(language, conf, false, 'keyup');
572566
}
@@ -1214,9 +1208,9 @@
12141208
if ($inputs.length > 0 ) {
12151209
var type = $inputs.eq(0).attr('type');
12161210
if (type === 'radio' || type === 'checkbox') {
1217-
return $inputs.filter(':checked').val();
1211+
return $inputs.filter(':checked').val() || '';
12181212
} else {
1219-
return $inputs.val();
1213+
return $inputs.val() || '';
12201214
}
12211215
}
12221216
return false;

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.28
4+
* @version 2.3.29
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: 1 addition & 1 deletion
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.28",
10+
"version": "2.3.29",
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.28",
4+
"version": "2.3.29",
55
"main": "./form-validator/jquery.form-validator.min.js",
66
"keywords": [
77
"form",

src/main/jquery-plugins.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,6 @@
178178
*/
179179
$.fn.validateInputOnBlur = function (language, conf, attachKeyupEvent, eventType) {
180180

181-
console.log('validating '+this.get(0).name+' on blur');
182-
183181
$.formUtils.eventType = eventType;
184182

185183
if ( this.willPostponeValidation() ) {
@@ -227,7 +225,6 @@
227225
}
228226

229227
if (!result.isValid && attachKeyupEvent) {
230-
console.log('in here');
231228
$elem.validateOnKeyUp(language, conf);
232229
}
233230

@@ -241,12 +238,9 @@
241238
this.each(function() {
242239
var $input = $(this);
243240
if (!$input.valAttr('has-keyup-event')) {
244-
console.log('Applygin keyup-validation on '+this.name);
245-
console.log((new Error()).stack);
246241
$input
247242
.valAttr('has-keyup-event', 'true')
248243
.bind('keyup.validation', function (evt) {
249-
console.log('key up');
250244
if( evt.keyCode !== 9 ) {
251245
$input.validateInputOnBlur(language, conf, false, 'keyup');
252246
}

src/main/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@
107107
if ($inputs.length > 0 ) {
108108
var type = $inputs.eq(0).attr('type');
109109
if (type === 'radio' || type === 'checkbox') {
110-
return $inputs.filter(':checked').val();
110+
return $inputs.filter(':checked').val() || '';
111111
} else {
112-
return $inputs.val();
112+
return $inputs.val() || '';
113113
}
114114
}
115115
return false;

0 commit comments

Comments
 (0)