I have a functionality so that when you want to delete a Patient by clicking on delete, ask if you really want to delete it or not.
It shows the question, but when I give it to cancel it erases it to me equally and if I give it to accept it happens the same.
The onClick
to call the JavaScript function is within a <tr>
, that <tr>
main also has a onClick
, I do not know if that can cause any conflict.
This is the code used:
JS:
function irAWeb(event) {
if (confirm("¿Quieres ir a la página del Mensajeitor?") == false) {
event.stopPropagation();
event.preventDefault();
return false;
}
return true;
}
HTML:
<a onclick="return irAWeb();" href='pagines/esborrar.asp?id=<%=rs("Numero")%>&que=<%=nomfitxer%>'> <img src="images/delete.gif" border="0" alt="Borrar" /> </a>