I have the same problem, html5 bubbles do not appear when you capture the on.click event and do something with it, for example to continue with ajax after the html5 validation.
I have observed that if there is any code (a simple alert) in the capture of the click event, it is not shown the validation errors of html5 corresponding to each field (the bubbles)
It is intended that the validation of existing html5 works (that this is not lost and work correctly) and that greater than that can capture the click event and continue doing operations from javascript
HTML5 whith require inputs where bubble must apear!
<form id='form_insertar' method="post">
<div class="modal-body">
<div class="form-group">
<label for="first_name">First Name</label>
<input type="text" id="first_name" placeholder="First Name" class="form-control" maxlength="100" required />
</div>
<div class="form-group">
<label for="last_name">Last Name</label>
<input type="text" id="last_name" placeholder="Last Name" class="form-control" required />
</div>
<div class="form-group">
<label for="email">Email Address</label>
<input type="text" id="email" placeholder="Email Address" class="form-control" required/>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" id='btn_addRecord' class="btn btn-primary">Add Record</button>
</div>
</form>
JavaScript code that makes it isn´t appear:
$(document).ready(function(){
$('#btn_addRecord').on("click", function(event){
//event.preventDefault();
if ($("#form_insertar")[0].checkValidity()) {
console.log('Validado el form: Inserta los datos con ajax!');
//addRecord();
return true;
}
if (!$("#form_insertar")[0].checkValidity()) {
console.log('No validado el form: Devolvemos false y no hacemos nada. (LAMENTABLEMENTE HAY ALGO DESCONOCIDO POR LO QUE NO SE MUESTRAN LOS BUBBLES o ERRORES)');
return false;
}
//alert('test');
});
});