Currently, my form sends the same email several times, in case the user clicks more than once on the submit. How can I prevent this? I tried with these two variations of the code, but it did not work.
$("#bt-enviar").on('click', function() {
$(this).attr('disabled','true');
$(this).css('cursor', 'default');
});
and
desab=0;
if(desab == 1){
$('#bt-enviar').attr('disabled','true');
$('#bt-enviar').css('cursor', 'default');
}
$("#bt-enviar").on('click', function() {
desab=1;
});