I have done a bootstrap form in a modal, that when I give a submit button "save", I save the values of the fields in the database. So far so good.
I would like that before sending the values, the fields will be validated, to see if a field is empty or there is something that does not want to put, as an age in negative.
I have understood that all people use jquery but for me it is a mess of the ciborium, but if you have to do it that way, go ahead. Well, nothing, I ask you as something that the fields are validated and that those alerts come out above the modal so pretty bootstrap.
Here I leave my form
<div class="modal" id="nuevoUsu" tabindex="-1" role="dialog" aria-labellebdy="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4>Nuevo Contacto</h4>
</div>
<div class="modal-body">
<form action="insertar.php" method="GET">
<div class="form-group">
<label for="nombre">Nombre:</label>
<input class="form-control" id="nombre" name="nombre" type="text" placeholder="Nombre"></input>
</div>
<div class="form-group">
<label for="edad">Edad:</label>
<input class="form-control" id="edad" name="edad" type="text" placeholder="Edad"></input>
</div>
<div class="form-group">
<label for="direccion">Direccion:</label>
<input class="form-control" id="direccion" name="direccion" type="text" placeholder="Direccion"></input>
</div>
<input type="submit" class="btn btn-success" value="Salvar">
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-warning" data-dismiss="modal">Cerrar</button>
</div>
</div>
</div>
</div>
Sorry if I offended someone because of my poor ability to program, but at my age it is already difficult to learn.