<form method="post" name="modif_familia" id="modif_familia">
<div class="modal fade" id="modificar_familia" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">Modificar Familia</h4>
            </div>
            <div class="modal-body">
                <div id="resultados_fam"></div> 
                <div class="form-group  ">
                    <label for="nombres" class="col-sm-4 control-label">Nombre</label>
                    <input type="hidden" class="form-control" id="id" name="id" required >
                    <input type="text" class="form-control" id="nombre" name="nombre"  required>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
                    <button type="submit" id="btn_fam"  class="btn btn-success">Modificar</button>
                </div>
            </div>
        </div>
    </div>
</div>
</form>
<script >
  $("#modif_familia" ).submit(function( event ) {
  $('#btn_fam').attr("disabled", true);

 var parametros = $(this).serialize();
   $.ajax({
      type: "POST",
      url: "php_familias/editar_familia.php",
      data: parametros,
        beforeSend: function(objeto){
         $('#resultados_fam').html('<center><img src="./img/ajax-loader.gif"> CARGANDO...</center>');
        },
      success: function(datos){
      $("#resultados_fam").html(datos);
      $('#btn_fam').attr("disabled", false);
      load(1);
      }
  });
  event.preventDefault();
})
</script>
