I have this code in my JS:
$('#form-sign-in').bind('submit', function(e)
And in my FORM
it has a Input Type Submit
. When I click on it to make a simple registration, it is sending two requests.
I'm using ajax .
I see the Google Inspect Element on the XHR tab and it shows me two requests for the signup page.
$.ajax({
type: "POST",
url: baseURL + '/form-cadastro',
data: $(this).serialize(),
beforeSend: function(){
$("#confirmar-cadastro").val('Aguarde...').prop('disabled');
},
success: function(result){
$('input, label').hide();
$('.message').html(result).addClass('message');
setTimeout(function(){
$('.message').html('').addClass('message');
$('input, label').show();
$("#confirmar-cadastro").val('Confirmar').removeProp('disabled');
}, 4000);
}
});