Bootstrap: jQuery Validation Plugin causes input group to have wrong height

Created on 12 Jul 2015  Â·  3Comments  Â·  Source: twbs/bootstrap

I am using Prepended text for showing a euro sign before the textbox. Also i am using JQuery Validation Plugin (link to the plugin)

When the error message appears under the field the sign of the euro covers 2 lines (the textbox and the error line)

after

The code

<div class="col-md-5">
            <div class="input-group">
              <span class="input-group-addon">€</span>
              <input id="worth" name="worth" class="form-control error" placeholder="" type="text" required=""><label for="worth" generated="true" class="error">error message</label>
            </div>

</div>

Most helpful comment

errorPlacement: function ( error, element ) {

        if(element.parent().hasClass('input-group')){
          error.insertAfter( element.parent() );
        }else{
            error.insertAfter( element );
        }

},

Use this

All 3 comments

Can you post a working example please with jsbin?

Putting a <label> within an .input-group like that is invalid. Please file a bug against the plugin.

errorPlacement: function ( error, element ) {

        if(element.parent().hasClass('input-group')){
          error.insertAfter( element.parent() );
        }else{
            error.insertAfter( element );
        }

},

Use this

Was this page helpful?
0 / 5 - 0 ratings

Related issues

devfrey picture devfrey  Â·  3Comments

kamov picture kamov  Â·  3Comments

ghost picture ghost  Â·  3Comments

IamManchanda picture IamManchanda  Â·  3Comments

devdelimited picture devdelimited  Â·  3Comments