Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap validation message is pushing down the rest of my form

I created a simple form in CodePen. The required validation on the name field works just fine. However, I want to put a little bit of padding between the two fields and when the error message is supposed to display...fill in that gap (meaning, the fields below where the error message appears does not get pushed down). Instead, it keeps pushing the fields down to make room for the error. When the error is fixed, the field is pulled back up.

I want something like this:

enter image description here

enter image description here

I have tried setting the position of .errorMessage but this changed nothing.

.errorMessage{
        position: relative;
        //position: absolute;  <--I've tried this, too
    }

What am I doing incorrectly?

like image 950
Holt Avatar asked Oct 18 '22 23:10

Holt


1 Answers

Check out this code pen:http://codepen.io/Sky-123/pen/QKoLEz

Did slight workarounds in css:

div.form-group{
  margin-bottom:35px
}

div.has-error{
 height:0px 
} 
like image 139
Aakash Thakur Avatar answered Oct 21 '22 02:10

Aakash Thakur