Disable submit button with jquery?

0

I have a submit button to send a form and go to another page:

<button type="submit" id="btnlog" class="btn btn-lg" value="" >Ingresar</button>

and by disabling the button with jquery

$('#btnlog').click(function () {
        $('#btnlog').attr('disabled', true);
});

does not load the other page that should go, if I remove the action jquery of the button works perfect and takes me to the other page

    
asked by Alcides Salazar 03.12.2016 в 03:00
source

1 answer

0

Something like that is going to help you

$("#submitId").closest('form').on('submit', function(e) {
    e.preventDefault();
    $('#btnlog').attr('disabled', true);
    this.submit(); // ahora hace el submit de tu formulario.
});
    
answered by 03.12.2016 / 03:15
source