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 problems with DropDownList
, because the same default
has the Selected value. Would you like to adjust for Selected to perform validation?