<div id="cancelar" class="modal fade" tabindex="-1" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header" style="background-color: red;">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">Cancelar Venta</h4>
            </div>
            <div class="modal-body">
                <form name="from_cancelar" id="from_cancelar" method="post" action="" >
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">NO</button>
                        <button name="btn_cancelar" value="btn_cancelar" type="submit" class="btn btn-danger"><i class="icon-ok"></i> <strong>SI</strong></button>
                    </div>
                </form>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div>

<script type="text/javascript">
$( "#from_cancelar" ).submit(function( event ) {
$('#btn_cancelar').attr("disabled", true);
var parametros = $(this).serialize();
    $.ajax({
        type: "POST",
        url: "php_facturar/cancelar.php",
        data: parametros,
        beforeSend: function(objeto){
            $('#carga').html('<center><img src="./img/ajax-loader.gif"> CARGANDO...</center>');
        },
        success: function(datos){
        $("#carga").html(datos);
        $('#btn_cancelar').attr("disabled", false);

        $('#cancelar').modal('hide');
        $('body').removeClass('modal-open');
        $('.modal-backdrop').remove();
        loadTabla();
        loadtotal();
        loadcliente();
        loadbotones();
        limpiar_campos();
        limpiar_buscador()
        load(1);
        }
  });
  event.preventDefault();
})
</script>