Skip to content

Commit 133e6a8

Browse files
committed
Fix for issue victorjonsson#112
1 parent 2f392ea commit 133e6a8

13 files changed

+38
-19
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,10 @@ it calls jQ func **$.formUtils.validateInput** to validate the single input when
298298
* Now possible to define an error message for each validation rule on a certain input (issue #113)
299299
* This plugin now serves as a html5 fallback. You can now use the native attributes to declare which type
300300
of validation that should be applied.
301+
* Use a template for error messages when having errorMessagePosition set to top
302+
* Event onElementValidate added
303+
* Use the attribute data-validation-confirm to declare which input that should be confirmed when using validation=confirmation (issue #112)
304+
301305

302306

303307
#### 2.1.47
@@ -371,6 +375,7 @@ calling $.validate()
371375

372376
#### Contributors
373377
<a href="http://stevewasiura.waztech.com" target="_blank">Steve Wasiura</a><br />
378+
<a href="http://lagden.github.com" target="_blank">Thiago Lagden</a><br />
374379
<a href="https://github.com/robamaton" target="_blank">Joel Sutherland</a><br />
375380
<a href="https://github.com/mattclements" target="_blank">Matt Clements</a><br />
376381
<a href="http://www.joshtoft.com/" target="_blank">Josh Toft</a><br/>

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

form-validator/form-test.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,11 @@
228228
</div>
229229
<div class="form-group">
230230
<label class="control-label">E-mail</label>
231-
<input name="test" data-validation="email" data-validation-error-msg="E-mail is not valid" />
231+
<input name="testmail" data-validation="email" data-validation-error-msg="E-mail is not valid" />
232+
</div>
233+
<div class="form-group">
234+
<label class="control-label">Confirm e-mail</label>
235+
<input name="test" data-validation="confirmation" data-validation-confirm="testmail" />
232236
</div>
233237
<div class="form-group">
234238
<label class="control-label">Alphanumeric (will only be validated if the checkbox is checked)</label>
@@ -262,6 +266,10 @@ <h2>HTML5 attributes</h2>
262266
<label class="control-label">type="number"</label>
263267
<input type="number" required="required" />
264268
</div>
269+
<div class="form-group">
270+
<label class="control-label">type="number"</label>
271+
<input type="number" required="required" maxlength="30" />
272+
</div>
265273
<div class="form-group">
266274
<label class="control-label">type="number" range[-5;5]</label>
267275
<input type="number" min="-5" max="5" required="required" />

form-validator/html5.dev.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
* @website http://formvalidator.net/
1515
* @license Dual licensed under the MIT or GPL Version 2 licenses
16-
* @version 2.1.50
16+
* @version 2.1.53
1717
*/
1818
(function($, window) {
1919

@@ -66,16 +66,21 @@
6666
break;
6767
}
6868

69-
if( validation.length && !isRequired ) {
70-
attrs['data-validation-optional'] = 'true';
71-
}
72-
7369
if( $input.attr('pattern') ) {
7470
validation.push('custom');
7571
attrs['data-validation-regexp'] = $input.attr('pattern');
7672
}
73+
if( $input.attr('maxlength') ) {
74+
validation.push('length');
75+
attrs['data-validation-length'] = 'max'+$input.attr('maxlength');
76+
}
77+
7778

7879
if( validation.length ) {
80+
if( !isRequired ) {
81+
attrs['data-validation-optional'] = 'true';
82+
}
83+
7984
foundHtml5Rule = true;
8085
$input.attr('data-validation', validation.join(' '));
8186

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 & 1 deletion
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.50
8+
* @version 2.1.53
99
*/
1010
(function($) {
1111

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

Lines changed: 3 additions & 3 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.50
13+
* @version 2.1.53
1414
*/
1515
(function($) {
1616

form-validator/security.dev.js

Lines changed: 3 additions & 2 deletions
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.50
15+
* @version 2.1.53
1616
*/
1717
(function($) {
1818

@@ -37,8 +37,9 @@
3737
name : 'confirmation',
3838
validatorFunction : function(value, $el, config, language, $form) {
3939
var conf = '',
40-
confInputName = $el.attr('name') + '_confirmation',
40+
confInputName = $el.valAttr('confirm') || ($el.attr('name') + '_confirmation'),
4141
confInput = $form.find('input[name="' +confInputName+ '"]').eq(0);
42+
4243
if (confInput) {
4344
conf = confInput.val();
4445
} else {

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

0 commit comments

Comments
 (0)