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

232
Views
El botón Cancelar para el mensaje emergente antes de eliminar no funciona

Tengo un problema donde, cuando aparece el mensaje de confirmación, hago clic en el botón cancelar, los datos también se eliminarán. ¿Alguien puede sugerir dónde se necesita arreglar? A continuación se muestra el código.

 echo "<a onClick='myFunction()' href='./delete.php?userID=".$row['userID'] ."'><button>Delete</button></a>"; <script> function myFunction() { $r = confirm("OK to delete?"); if ($r == false) { return false; } } </script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

El evento de la etiqueta de anclaje debe evitarse cuando se hace clic en 'Cancelar' con event.preventDefault() .

Ejemplo

 <a onClick="myFunction()" href="https://google.com">Delete <script> function myFunction() { let r = confirm("OK to delete?"); if (r == false) { // It will prevent visit to 'https://google.com' return event.preventDefault(); } } </script>

about 4 years ago · Juan Pablo Isaza Report
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!