Javascript Confirm Delete

Use a javascript confirm box to ask the user if they want to delete

<script>
function confirmDelete(delUrl) {
  if (confirm("Are you sure you want to delete")) {
    document.location = delUrl;
  }
}
</script>

<a href="javascript:confirmDelete('delete.page?id=1')">Delete</a>
Another way

<a href="delete.page?id=1" onclick="return confirm('Are you sure you want to delete?')">Delete</a>


javascript confirm alert


Back To Top
© 1998 - 2017 psacake.com | My3C's

Version 7.2 | Advertise on this site