Hello! I am using an ajax on a button so when I click on it it submits a form, the button then changes from VALID to VALIDATED, all without reloading the page.
Here is the code:
$('#validar_form').submit(function(event){
$.ajax({
url: 'valida_horaextrarh.php',
type: 'post',
dataType:'html',
data: $('#validar_form').serialize(),
success: function(response, textStatus, jqXHR){
$('#principal').html(response);
},
error: function(jqXHR, textStatus, errorThrown){
console.log('error(s):'+textStatus, errorThrown);
}
});
});
The problem is that the current code only allows me to click on the buttons in the order they are displayed, image below:
If I try to validate the request of Person 3, I need to validate Person 2 first, otherwise the button does not execute ajax.
How do I resolve this so that I can click the buttons in any order?