Konfirmasi Hapus

Berikut ini adalah syntax untuk konfirmasi hapus di PHP.
_______________________________________________

<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>
_______________________________________________
Dan cara singkatnya seperi ini :
__________________________

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

Semoga bermanfaat :)
Konfirmasi Hapus Konfirmasi Hapus Reviewed by Syawaluddin Amin, S.Kom on Maret 23, 2013 Rating: 5

Tidak ada komentar:

Diberdayakan oleh Blogger.