I'm currently working on login form and trying to develop the functionality I need it to do when the validation does not pass on the client side.
This is the current HTML I have that is rendered before the login form is validated. I'm wanting to place the error after the div class input-group. It is still placing it after the form-control instead.
<div class="input-group mb15">
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
<input type="text" class="form-control" placeholder="Email Address" name="email_address">
</div><!-- input-group -->
<div class="input-group mb15">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
<input type="password" class="form-control" placeholder="Password" name="password">
</div><!-- input-group -->
jQuery Validation Process
$("#login-form").validate({
highlight: function(element) {
$(element).closest('.input-group').removeClass('has-success').addClass('has-error');
},
errorPlacement: function(error, element) {
error.appendTo(element.parent('.input-group'));
}
});