The validation of jquery.validate.js
only works when input
is within <div class="form-group">
, for example if I put the code:
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12">
<div class="inner-addon left-addon">
<i class="glyphicon glyphicon-log-in"></i>
<input id="id_codigo_empresa" name="codigo_empresa"
type="number" class="form-control" maxlength="6"
placeholder="Código da entidade" required>
</div>
</div>
</div>
If you leave input
empty and click the submit button it does not show the 'Campo requerido'
message on the screen, but if I do:
<div class="form-group">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12">
<div class="inner-addon left-addon">
<i class="glyphicon glyphicon-log-in"></i>
<input id="id_codigo_empresa" name="codigo_empresa"
type="number" class="form-control" maxlength="6"
placeholder="Código da entidade" required>
</div>
</div>
</div>
</div>
Adding a div
with form-group
works, but I do not want to use form-group
because it takes the formatting from the field and then changes the design.
Is there any way to use the validator without form-group
?
Just to complement, it validates, but does not display the message without form-group
.
If I add my style changes to the form group the thing gets a bit bizarre. below the image of the field with the form-group and without it, see that the input was square and without borders and as it had diminished the margin-botton the error label is behind the input.