This repository has been archived by the owner on Mar 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Compatibility with selectpicker? #115
Comments
I have run into issue that selectpicker (https://github.com/silviomoreto/bootstrap-select) is not validated with bootstrap-validator. The cause of this behaviour is that selectpicker makes the underlying bootstrap-validator/js/validator.js Line 32 in 1c73a7a
If remove |
I had the same issue using bootstrap-select (selectpicker). I solved it by doing this: $('.selectpicker').on('change', function() {
var m, h, x, $el = $(this);
var fg = $el.parents('div.form-group');
if ($el[0].hasAttribute('required') || $el.is('[required]')) {
if ($el[0].checkValidity() === false) {
m = $el.data('error');
h = '<ul class="list-unstyled"><li>' + m + '</li></ul>';
fg.addClass('has-errors').find('div.help-block').html(h);
//console.log(m);
}
else {
fg.removeClass('has-errors').find('div.help-block').html('');
}
}
}); |
+1 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Anyone have any tips or know if this is compatible with bootstrap selectpicker?
The text was updated successfully, but these errors were encountered: