-1
if I put only one variable works, but I also need to pass $city to the onclick, but I don’t know how to concatenate in the right way. (deleteVaga function)
while($registros = $querySelect->fetch_assoc()){
$id = $registros['id'];
$cidade = $registros['cidade'];
$empresa = $registros['empresa'];
$setor = $registros['setor'];
$remuneracao = $registros['remuneracao'];
$beneficios = $registros['beneficios'];
$nivel_estagio = $registros['nivel_estagio'];
$vinculo = $registros['vinculo'];
$processo_sel = $registros['processo_seletivo'];
$contato = $registros['contato'];
echo '<button onclick="deleteVaga('.$id.'.','.'.$cidade.')"><i class="far fa-trash-alt" style="font-size:36px;color:#f00;"></i></button>';
echo "</tr>';
I need the ajax in another file to receive these two parameters
– Luan Rodrigues
but keeps making a mistake
– Luan Rodrigues
I am using single quotes to open the echo and double quotes to open the functions
– Luan Rodrigues
Analyzed the generated HTML as suggested? What did you conclude?
– Woss
yes, it generates the results in the table, but does not delete
– Luan Rodrigues
Function deleteVaga(deleteid,city){ var conf = confirm('Do you really want to delete this wave?'); if(conf==true){ $.ajax({ url: "banco_de_data/delete.php", type: "post", date: {deleteid: deleteid, city: city}, Success: Function(data, status){ viewVagas(); } }); }
} }
– Luan Rodrigues
sorry the code, came out as common text
– Luan Rodrigues
If the generated HTML is correct and the function is called correctly, your question has been answered. If jQuery is also in trouble, I suggest opening another question.
– Woss