Skip to content

Commit 950cb47

Browse files
committed
Added bug fix in html5-module, an input only being required did not get any validation attribute
1 parent c58dda7 commit 950cb47

19 files changed

+31
-25
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.34
13+
* @version 2.2.35
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/#file-validators
1212
* @license Dual licensed under the MIT or GPL Version 2 licenses
13-
* @version 2.2.34
13+
* @version 2.2.35
1414
*/
1515
(function($, window) {
1616

form-validator/form-test.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@
8080
<div class="form-group">
8181
<label class="control-label">Year</label>
8282
<input name="birth" class="form-control"
83-
data-validation="date"
83+
data-validation="length date"
84+
data-validation-length="min5"
8485
data-validation-format="yyyy/mm/dd"
8586
data-suggestions="2014/01/15,2014/01/16,2014/01/17" />
8687
</div>
@@ -158,16 +159,19 @@
158159
<label class="control-label">Server validation</label>
159160
<input class="form-control" name="code" value="secret"
160161
data-validation-helssp="The word is &quot;secret&quot;"
161-
data-validation="server"
162+
data-validation="length server"
163+
data-validation-length="min2"
162164
data-validation-url="http://formvalidator.net/validate-email.php" />
163165
</div>
164166
<div class="form-group">
165167
<label class="control-label">File validation</label>
166168
<input type="file" name="some-file1" class="form-control"
167-
data-validation="size mime required"
169+
data-validation="size mime required dimension"
168170
data-validation-error-msg-size="The file cant be larger than 400kb"
169171
data-validation-error-msg="You must upload an image file (max 400 kb)"
170172
data-validation-allowing="jpg, png, ico"
173+
data-validation-dimension="100-800"
174+
data-validation-ratio="8:10-12:10"
171175
data-validation-max-size="400kb" />
172176
</div>
173177
<div class="form-group">

form-validator/html5.dev.js

Lines changed: 5 additions & 2 deletions
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.34
20+
* @version 2.2.35
2121
*/
2222
(function($, window) {
2323

@@ -102,7 +102,7 @@
102102

103103
if( suggestions.length == 0 ) {
104104
// IE fix
105-
var opts = $.trim($('#'+$input.attr('list')).text()).split('\n')
105+
var opts = $.trim($('#'+$input.attr('list')).text()).split('\n');
106106
$.each(opts, function(i, option) {
107107
suggestions.push($.trim(option));
108108
});
@@ -113,6 +113,9 @@
113113
$.formUtils.suggest( $input, suggestions );
114114
}
115115

116+
if( isRequired && validation.length == 0 )
117+
validation.push('required');
118+
116119
if( validation.length ) {
117120
if( !isRequired ) {
118121
attrs['data-validation-optional'] = 'true';

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: 1 addition & 2 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.34
8+
* @version 2.2.35
99
*/
1010
(function ($) {
1111

@@ -870,7 +870,6 @@
870870
* Validate the value of given element according to the validation rules
871871
* found in the attribute data-validation. Will return an object representing
872872
* a validation result, having the props shouldChangeDisplay, isValid and errorMsg
873-
* 8420-2 8430 97 99 1-7
874873
* @param {jQuery} $elem
875874
* @param {Object} language ($.formUtils.LANG)
876875
* @param {Object} conf

form-validator/jquery.form-validator.min.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/jsconf.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* @website http://formvalidator.net/#location-validators
99
* @license Dual licensed under the MIT or GPL Version 2 licenses
10-
* @version 2.2.34
10+
* @version 2.2.35
1111
*/
1212
(function($) {
1313

form-validator/lang/de.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* @website http://formvalidator.net/
88
* @license Dual licensed under the MIT or GPL Version 2 licenses
9-
* @version 2.2.34
9+
* @version 2.2.35
1010
*/
1111
(function($, window) {
1212

form-validator/lang/es.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* @website http://formvalidator.net/
88
* @license Dual licensed under the MIT or GPL Version 2 licenses
9-
* @version 2.2.34
9+
* @version 2.2.35
1010
*/
1111
(function($, window) {
1212

form-validator/lang/fr.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* @website http://formvalidator.net/
88
* @license Dual licensed under the MIT or GPL Version 2 licenses
9-
* @version 2.2.34
9+
* @version 2.2.35
1010
*/
1111
(function($, window) {
1212

form-validator/lang/sv.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* @website http://formvalidator.net/
88
* @license Dual licensed under the MIT or GPL Version 2 licenses
9-
* @version 2.2.34
9+
* @version 2.2.35
1010
*/
1111
(function($, window) {
1212

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

form-validator/security.dev.js

Lines changed: 3 additions & 3 deletions
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.34
16+
* @version 2.2.35
1717
*/
1818
(function($, window) {
1919

@@ -491,8 +491,8 @@
491491

492492
return new RegExp(pattern).test(val);
493493
},
494-
errorMessage : 'aaaa',
495-
errorMessageKey: ''
494+
errorMessage : '',
495+
errorMessageKey: 'requiredFields'
496496
});
497497

498498

0 commit comments

Comments
 (0)