At the moment I'm sending the whole form, I need to send only one html field by ajax, the IdApart is dynamic and comes from the database follows my ajax code and the field I need to send:
AJAX
$(function () {
$("#visualizarAparelhos").submit(function (e) {
e.preventDefault();
var FormData = $("#visualizarAparelhos").serialize();
$.ajax({
type: "POST",
url: "administrador.php",
data: FormData
}).done(function (data) {
console.log(data);
});
return false;
alert("Não enviou!!!");
});
});
FIELD TO BE SENT:
print "<td><button id='IdAparelho' value='".$id."' type='submit' class='btn btn-primary' data-toggle='modal' data-target='#modalVisualizarComponentes'>".$id."</button></td>";