Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

196
Visualizações
Sweetalert2 does not work correctly in pivot table

I have a table that receives data from MYSQL, and there is a column in the table that triggers some options when clicked. however Sweetalert2 only works on the first line of records. that is. if by chance there is a record to present and the user clicks the action button, sweetalert2 works normally, but if there is more than 1 record to present, sweetalert2 does not work on the following lines. what did I do wrong?

What I did is the following:

<script>
var ajuda1 = document.getElementById("aceito"); 
if(ajuda1){ajuda1.addEventListener("click", exibeMensagem_quando_pendente); 
function exibeMensagem_quando_pendente(){ 
Swal.fire({  
position: 'center', 
icon: 'success', 
title: 'Pedido foi aceito', 
showConfirmButton: false, 
timer: 1500 })}};</script>

<td>
<?php if($row["status"] == "Pendente") : ?>
<a href="javascript:setTimeout(()=>{window.location = '<?php echo $baseurl ?>.editstatusorderfor_accepted.php?&id=<?php echo $row['id']; ?>'},1500);">
<button title="Aceitar" id="aceito"  class="button_status_aceito"><i class="icon-like"></i></button></a><?php endif ?>

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda