When I try to validate a select2 what I get is the same text as the label
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label for="cboMetodoPago">Método de pago <span class="required"></span></label>
<select class="form-control select2-nosearch" id="cboMetodoPago" name="cboMetodoPago" required></select>
</div>
</div>
</div>
This is how I configure the plugin
$(".formsave").validate({
highlight: function (element) {
jQuery(element).closest('.form-group').addClass('has-error');
},
success: function (element) {
jQuery(element).closest('.form-group').removeClass('has-error');
},
ignore: ["input[type=hidden]"],
onfocusout: false,
invalidHandler: function (form, validator) {
var error = validator.numberOfInvalids();
if (error) {
validator.errorList[0].element.focus();
}
},
message: {
cboMetodoPago: {
required: "Este campo es obligatorio"
}
}
});
And the text I get is the same as the label inside the form-group
Any way to replace the text with the corresponding one?
Regards
