I'm replacing the default errors with tooltips from bootstrap overriding the errorPlacement method. But when items are required and also have any other type of validation, the required supersedes any other error.
I'm wondering if I'm missing something in the validation or if this is expected behavior.
An example in jsfiddle is here: http://jsfiddle.net/CwnUR/8/
$(function() {
$('form').validate({
errorElement: 'span',
errorClass: 'error',
validClass: 'success',
errorPlacement: function (error, element) {
element.attr({ 'title': error.text() }).tooltip({
placement: 'right',
trigger: 'manual',
delay: { show: 500, hide: 5000 }
}).tooltip('show');
},
success: function (label, element) {
$(element).tooltip('destroy');
}
});
$("#exampleInputEmail1").rules("add", {
required: true,
email: true
});
$("#exampleInputEmail2").rules("add", {
required: true,
equalTo: $("#exampleInputEmail1"),
messages: {
equalTo: 'Please retype the same email again.'
}
});
});