0
I have the following code jQuery:
$("#aspnetForm").validate({
errorElement: 'span',
errorClass: 'help-block',
rules: {
Dropdown: {
required: true
}
},
messages: {
Dropdown: {
required: "Preencha o campo"
}
},
highlight: function (element) {
$(element)
.closest('.form-group').removeClass('has-success').addClass('has-error');
},
unhighlight: function (element) {
$(element)
.closest('.form-group').removeClass('has-error');
}
});
this same code works with my TextBox, but I’m having trouble with DropDownList, yeah, the same by default has the value Selected. It would have to adapt for while is marked the Selected he perform the validation?
The code worked for you?
– novic