jsfiddle.net
Código HTML :
<!DOCTYPE HTML> <html lang="es"> <head> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/jquery.validate.min.js"></script> <script type="text/javascript"> $('form').validate({ rules: { firstname: { minlength: 3, maxlength: 15, required: true }, lastname: { minlength: 3, maxlength: 15, required: true } }, highlight: function(element) { $(element).closest('.form-group').addClass('has-error'); }, unhighlight: function(element) { $(element).closest('.form-group').removeClass('has-error'); }, errorElement: 'span', errorClass: 'help-block', errorPlacement: function(error, element) { if(element.parent('.input-group').length) { error.insertAfter(element.parent()); } else { error.insertAfter(element); } } }); </script> </head> <body> <form method="POST"> <div class="form-group"> <label class="control-label" for="firstname">Nome:</label> <div class="input-group"> <span class="input-group-addon">$</span> <input class="form-control" placeholder="Insira o seu nome próprio" name="firstname" type="text" /> </div> </div> <div class="form-group"> <label class="control-label" for="lastname">Apelido:</label> <div class="input-group"> <span class="input-group-addon">€</span> <input class="form-control" placeholder="Insira o seu apelido" name="lastname" type="text" /> </div> </div> <button type="submit" class="btn btn-primary">Submit</button> </form> </body> </html>
que podria estar mal yo lo veo practicamente igual al jsfiddle