I have a form that is validated using validationform.io. There is no out of the box support for Bootstrap select, select fields.
I have this bit of jQuery code that will add the has-success class that adds a green border around the select box and this works fine. But as I'm only finding the .btn-light class it changes anything using that class.
Is there a way to add a CSS selector where class=".btn-light" and data-id="roleId"?
This is my jQuery:
fv.on('core.field.valid', function(field) {
if (field === 'roleId') {
$('.btn-light').addClass("has-success");
}
});
This is the html for the select :
<select class="selectpicker show-tick" data-style="btn-light" name="roleId" id="roleId">
this is what the bootstrap-select converts it to when checking in developer tools :
<button type="button" class="btn dropdown-toggle btn-light" data-toggle="dropdown" role="button" data-id="roleId" >