Skip to content
This repository was archived by the owner on Mar 12, 2020. It is now read-only.

Commit 8bcbbda

Browse files
committed
♨️ 0.11.7 ♨️
1 parent 1ae1440 commit 8bcbbda

File tree

7 files changed

+25
-15
lines changed

7 files changed

+25
-15
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
Changelog
22
=========
3+
### 0.11.7
4+
* Skip auto-validation of fields with errors that were set before plugin init. (#401)
5+
* Fixing non-multiple select validation, which accidentally broke in the last release. (#453)
6+
37
### 0.11.6
48
* Scope `focus` option's error scrolling to only inputs within the validator's form element. (#385)
59
* Fixing `<select multiple required />` being marked as invalid by default with jQuery 3.x (#393)

dist/validator.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Validator v0.11.6 for Bootstrap 3, by @1000hz
2+
* Validator v0.11.7 for Bootstrap 3, by @1000hz
33
* Copyright 2016 Cina Saffary
44
* Licensed under http://opensource.org/licenses/MIT
55
*
@@ -15,7 +15,7 @@
1515
function getValue($el) {
1616
return $el.is('[type="checkbox"]') ? $el.prop('checked') :
1717
$el.is('[type="radio"]') ? !!$('[name="' + $el.attr('name') + '"]:checked').length :
18-
$el.is('select') ? +$el.val() ? $el.val() : null :
18+
$el.is('select[multiple]') ? +$el.val() ? $el.val() : null :
1919
$el.val()
2020
}
2121

@@ -42,13 +42,16 @@
4242
})
4343
})
4444

45-
this.$inputs.filter(function () { return getValue($(this)) }).trigger('focusout')
45+
// run validators for fields with values, but don't clobber server-side errors
46+
this.$inputs.filter(function () {
47+
return getValue($(this)) && !$(this).closest('.has-error').length
48+
}).trigger('focusout')
4649

4750
this.$element.attr('novalidate', true) // disable automatic native validation
4851
this.toggleSubmit()
4952
}
5053

51-
Validator.VERSION = '0.11.6'
54+
Validator.VERSION = '0.11.7'
5255

5356
Validator.INPUT_SELECTOR = ':input:not([type="hidden"], [type="submit"], [type="reset"], button)'
5457

dist/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.

docs/dist/validator.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Validator v0.11.6 for Bootstrap 3, by @1000hz
2+
* Validator v0.11.7 for Bootstrap 3, by @1000hz
33
* Copyright 2016 Cina Saffary
44
* Licensed under http://opensource.org/licenses/MIT
55
*
@@ -15,7 +15,7 @@
1515
function getValue($el) {
1616
return $el.is('[type="checkbox"]') ? $el.prop('checked') :
1717
$el.is('[type="radio"]') ? !!$('[name="' + $el.attr('name') + '"]:checked').length :
18-
$el.is('select') ? +$el.val() ? $el.val() : null :
18+
$el.is('select[multiple]') ? +$el.val() ? $el.val() : null :
1919
$el.val()
2020
}
2121

@@ -42,13 +42,16 @@
4242
})
4343
})
4444

45-
this.$inputs.filter(function () { return getValue($(this)) }).trigger('focusout')
45+
// run validators for fields with values, but don't clobber server-side errors
46+
this.$inputs.filter(function () {
47+
return getValue($(this)) && !$(this).closest('.has-error').length
48+
}).trigger('focusout')
4649

4750
this.$element.attr('novalidate', true) // disable automatic native validation
4851
this.toggleSubmit()
4952
}
5053

51-
Validator.VERSION = '0.11.6'
54+
Validator.VERSION = '0.11.7'
5255

5356
Validator.INPUT_SELECTOR = ':input:not([type="hidden"], [type="submit"], [type="reset"], button)'
5457

0 commit comments

Comments
 (0)