Rahul Desai
Rahul Desai

Reputation: 15501

jQuery validate get the error message below the textbox / input element

http://jsfiddle.net/msbUM/ How do I get the error message below the textbox / input element?

Upvotes: 3

Views: 16682

Answers (3)

Pupil
Pupil

Reputation: 23958

Another quick solution can be to replace label as error element with div.

$(document).ready(function(){ 
    jQuery("#frmId").validate({
        errorElement:'div',
        rules: {
        // RULES //
        },
        messages: {
        // MESSAGES //
        } 
    });
});

Upvotes: 2

pgratton
pgratton

Reputation: 663

Just add display: block; to label.error:

label.error { 
   float: none; color: red; 
   padding-left: .5em;
   vertical-align: top; 
   display: block;
}​

Upvotes: 7

SLaks
SLaks

Reputation: 887529

Apply display:block to the error labels.

Upvotes: 7

Related Questions