The Netlobo logo - a Nevada desert landscape

Comments for Delete Confirmation using Javascript

< Back to the article

5 comments for this article.

RSS Feed Icon Subscribe to the comments for this article

Posted: 2007-09-12 15:20:17 by MathiVanan
Hi,

I have a Question. If we are given a constraint like, no alert boxes to be used in the application, what else could be the option other than having a check box like in the licence agreement options.

Thanks,
Mathi
Posted: 2007-09-12 15:26:36 by lobo235 - Netlobo Staff Member
You would have to do your delete confirmation on a separate page without using javascript. Some people consider this the best option anyway because a few users have JavaScript disabled so the JavaScript delete confirmation would not work for them anyway.

Another idea would be to use DHTML so that when the delete link is clicked it is replaced with a Yes/No confirmation inline.
Posted: 2007-10-19 08:59:06 by Luke
Great advice, just what I was looking for!
Tried and worked like a charm...
thank you very much!
Posted: 2008-01-21 08:54:41 by Shawson
why not simply have

function confirmDelete()
{
return confirm("Are you sure you wish to delete this entry?");
}

or even
<a href="?action=delete&id=3" onclick="return confirm('Are you sure you wish to delete this entry?');">
Delete this entry
</a>
Posted: 2008-01-21 08:59:08 by lobo235 - Netlobo Staff Member
I like the idea of making the function shorter and I will update the article to do it that way. The second method that you mentioned is not as portable and it is more typing each time you need to confirm a deletion. Great ideas though! Thanks for stopping by the site!

RSS Feed Icon Subscribe to the comments for this article

Post your comment for the Delete Confirmation using Javascript article:

Name (required) (letters and numbers only):
Email (required) (will not be published):
Website (include http://):
Comment (required): (HTML tags allowed: pre, strong, em, b, i)