Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

120
Views
Ventana emergente modal desde un enlace

Tengo el siguiente código

 echo "<td class = container_update ><a href = 'ShowAngajati.php?id=$row[ID_Angajati] &nm=$row[Nume] &pr=$row[Prenume] &cn=$row[CNP] &dn=$row[Data_Nasterii] &se=$row[Sex] &nr=$row[Numar_Telefon] &sa=$row[Salariu] ' id='myBtn'>Update</a></td>";

y el guion

 <script> // Get the modal var modal = document.getElementById("myModal"); // Get the button that opens the modal var btn = document.getElementById("myBtn"); // Get the <span> element that closes the modal var span = document.getElementsByClassName("close")[0]; // When the user clicks the button, open the modal btn.onclick = function() { modal.style.display = "block"; } // When the user clicks on <span> (x), close the modal span.onclick = function() { modal.style.display = "none"; } // When the user clicks anywhere outside of the modal, close it window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; } } </script>

La cosa es que quiero que aparezca un modal cuando hago clic en el enlace ("Actualizar"). Aparece, pero solo por un segundo (mientras la pestaña se actualiza) y aparece solo cuando hago clic en la primera fila de mi tabla. La conclusión sería: tendría una tabla grande (para una base de datos) con un botón de "actualización" en cada fila que, cuando hago clic, aparece un modal con un formulario ya completado (completado con los datos que ya están en mi base de datos) y simplemente cambie lo que quiero cambiar (es por eso que necesito las variables nm, pr, cn, etc.).

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!