How to: Delete confirmation
Posted in JavaScript, tech, tips, web on October 22nd, 2007 by Bryn – 2 CommentsHere is a really simple way of adding a extra layer of protection to a web interface that allows you to remove or delete files, articles etc. It is very easy to use and can save you from some real headaches. It is a very basic JavaScript function.
<a href=”delete.php?id=fileid” title=”‘filetitle’” onclick=”return confirm(\’Confirm delete of ‘filename’?\’)”>Delete</a>

This will create a prompt that comes up with “OK” or “Cancel”. This can easily be added to your site to give you an extra layer of protection against accidentally deleting your important files.







