Skip to content

Commit 9526675

Browse files
committed
Fixed issue victorjonsson#85
1 parent 9dd1e7e commit 9526675

File tree

10 files changed

+25
-22
lines changed

10 files changed

+25
-22
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ it calls jQ func **$.formUtils.validateInput** to validate the single input when
297297
#### 2.1.40
298298
* Incorrect error-styling when using datepicker or suggestions is now fixed
299299
* Incorrect error-styling of select elements is now fixed
300+
* Deprecated function $.validationSetup is now removed, use $.validate() instead
300301

301302
#### 2.1.36
302303
* Now possible to use the native reset() function to clear error messages and error styling of the input elements

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.1.42
13+
* @version 2.1.43
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.1.42
13+
* @version 2.1.43
1414
*/
1515
(function($, window) {
1616

form-validator/form-test.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@
8585
id="datepicker" />
8686
</div>
8787

88+
<div class="form-group">
89+
<label class="control-label">Number 0-10 (accepting floats)</label>
90+
<input name="floats" class="form-control"
91+
data-validation="number"
92+
data-validation-allowing="range[0;10], float"
93+
data-validation-decimal-separator=","
94+
/>
95+
</div>
96+
8897
<div class="form-group password-strength">
8998
<label class="control-label" for="password">Display password strength (only strong)</label>
9099
<input name="password" type="password" id="password" class="form-control" data-validation="strength" data-validation-strength="3" />

form-validator/jquery.form-validator.js

Lines changed: 7 additions & 14 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.1.42
8+
* @version 2.1.43
99
*/
1010
(function($) {
1111

@@ -169,7 +169,6 @@
169169
// This validation has to be postponed
170170
var _self = this;
171171
window.postponedValidation = function() {
172-
console.log('running the waiting validation');
173172
_self.validateInputOnBlur(language, conf, attachKeyupEvent);
174173
window.postponedValidation = false;
175174
};
@@ -521,17 +520,6 @@
521520
}
522521
};
523522

524-
/**
525-
* @deprecated
526-
* @param {Object} conf
527-
*/
528-
$.validationSetup = function(conf) {
529-
if( typeof console != 'undefined' && console.warn ) {
530-
console.warn('Using deprecated function $.validationSetup, pls use $.validate instead');
531-
}
532-
$.validate(conf);
533-
};
534-
535523
/**
536524
* Object containing utility methods for this plugin
537525
*/
@@ -1473,10 +1461,15 @@
14731461
allowsRange = true;
14741462
}
14751463

1464+
if( decimalSeparator == ',' ) {
1465+
// Fix for checking range with floats using ,
1466+
val = val.replace(',', '.');
1467+
}
1468+
14761469
if(allowing.indexOf('number') > -1 && val.replace(/[0-9]/g, '') === '' && (!allowsRange || (val >= begin && val <= end)) ) {
14771470
return true;
14781471
}
1479-
if(allowing.indexOf('float') > -1 && val.match(new RegExp('^([0-9]+)\\'+decimalSeparator+'([0-9]+)$')) !== null && (!allowsRange || (val >= begin && val <= end)) ) {
1472+
if(allowing.indexOf('float') > -1 && val.match(new RegExp('^([0-9]+)\\.([0-9]+)$')) !== null && (!allowsRange || (val >= begin && val <= end)) ) {
14801473
return true;
14811474
}
14821475
}

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.1.42
13+
* @version 2.1.43
1414
*/
1515
(function($) {
1616

form-validator/security.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
* @website http://formvalidator.net/#security-validators
1414
* @license Dual licensed under the MIT or GPL Version 2 licenses
15-
* @version 2.1.42
15+
* @version 2.1.43
1616
*/
1717
(function($) {
1818

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.1.42
16+
* @version 2.1.43
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.1.42
12+
* @version 2.1.43
1313
*/
1414
$.formUtils.addValidator({
1515
name : 'ukvatnumber',

0 commit comments

Comments
 (0)