I am trying to validate select box using ajax in codeigniter. I also tried revalidated with bootstrap validator but due to adding revalidated the whole validation is not working. Thats why I remove revalidated function. Now I use disabled. It now shows red line error its good. When I select subcategory then it should change in green color but it still show red color error.
Here is screen shot of problem
and second picture:
In this picture a real problem is shown
Here is my code of view file:
<form class="form-horizontal" id="form_professional" role="form" method="Post" action="">
<div class="col-md-6">
<div class="form-group">
<label for="select" class="control-label col-sm-4">Select Subcategory</label>
<div class="col-sm-8">
<select class="subcategory1" id="select" name="framework[]" multiple class="form-control">
</select>
</div>
</div>
</div>
</form>
I am getting data through ajax according to related category.Every thing working fine.But the problem is that when i click on submit button it show red color error on subcategory field because i used excluded = 'disable'. After the selecting multiple subcategory it still show red line error.It does not change in green line.
$(document).ready(function(){
$('.subcategory1').multiselect({
nonSelectedText: 'Select Subcategory',
enableFiltering: true,
enableCaseInsensitiveFiltering: true,
buttonWidth:'300px'
});
});
$('#form_professional').bootstrapValidator({
// To use feedback icons, ensure that you use Bootstrap v3.1.0 or later
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
excluded: ':disabled',
fields: {
professional_building:{
validators: {
regexp: {
regexp: /^[a-zA-Z0-9_\.\s]+$/,
message: 'The building name can only consist of alphabetical, number, dot and underscore'
}
}
},
'framework[]': {
validators: {
notEmpty: {
message: 'Please specify at least one browser you use daily for development'
}
}
}
});