0

I have currently 2 input fields on the same line to be validated with vee-validate (I am using Vue.js).

form inputs

The validation message is displayed at the end of the input-group, not inside it.

form inputs error

Here is the html code:

<div class="form-group row d-flex justify-content-center">
  <div class="input-group input-group-lg col-md-3" >
    <input v-validate="'required'" name="username" v-model="username" type="text" class="form-control" placeholder="Your Name" aria-label="Name">
     <span v-show="errors.has('username')" class="help is-danger">{{ errors.first('username') }}</span>
  </div>
  <div class="input-group input-group-lg col-md-4" >
    <input v-validate="'required|email'" name="email" v-model="email" type="text" :class="{'input': true, 'is-danger': errors.has('email') }" class="form-control" placeholder="Your Email Address" aria-label="Email">
     <span v-show="errors.has('email')" class="help is-danger">{{ errors.first('email') }}</span>
  </div>
</div>

What's wrong with my code?

Hans Felix Ramos
  • 4,264
  • 3
  • 16
  • 40

1 Answers1

1

Use Bootstrap .help-block class in your error text.

ed1nh0
  • 1,532
  • 13
  • 17
  • 1
    Thanks ed1nh0..; tried it . ( see my update below the question... no change in the display . it seems thet the input-group is resized to accomodate the input field ( reduced size) and the p paragraph w the message .. –  Feb 09 '18 at 12:29
  • Got it ... need to remove the input-goup which using flex ... I tried to set it to flex: none; but it does not change its behavior... –  Feb 09 '18 at 12:50