Click on Save modal closure

0

The delete command works but I want the modal to be closed when it is removed

<form action="" id="feliminar" novalidate="novalidate">
<div class="modal fade" id="ModalEliminar" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog modal-sm" 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" id="myModalLabel">Eliminar Registro</h4>
            </div>
            <div class="modal-body">
                <h2>¿ Desea Eliminar Registro ? </h2>
            </div>
            <div class="modal-footer">
                <a Id="button" class="btn btn-default" data-dismiss="modal">No</a>
                <a id="btn_eliminar" class="btn btn-warning" data-dismiss="modaldelete" href="javascript:fn_tab1_eliminar_submit();">Eliminar</a>

I have the java script this way

function fn_tab1_eliminar_submit() //eliminar
{
    var formid = "feliminar";
    if (!utils_validateInputs(formid, "#divMensajeEdicion")) return;
    var arrObj;
    arrObj = utils_getInputs_arrayObj(formid);
    utils_Ajax('2_Model/persona_service.php', 'delete', arrObj,
        '#divMensajeEdicion', fn_tab1_guardar_submit_response, formid, 2000, 5000);
    alertify.confirm('Confirm Message', function() {
        alertify.success('Ok')
    });

}

function fn_tab1_eliminar_Id(f, controlId) {

    $('#btnEliminarModal').click();
    var arrObj = [{
        Id: "id",
        Value: controlId
    }];
    utils_Ajax('2_Model/persona_service.php', 'delete', arrObj, '#divMensajeEdicion', fn_tab1_eliminar_Id_response, f, 0, 5000);
}

function fn_tab1_eliminar_Id_response(objData, formid) {
    utils_setInputsArray(formid, objData.datos);

}
    
asked by Kristian Espitia 14.11.2018 в 15:27
source

1 answer

1

You can hide your modal like this:

$('#myModal').modal('hide');

Where #myModal is the id of the html element and .modal () is the method for bootstrap manners

    
answered by 14.11.2018 в 15:53