Comments for Delete Confirmation using Javascript
9 comments for this article.
Subscribe to the comments for this article
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.
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!
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>
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!
Posted: 2009-04-02 20:10:14 by Thura
Thanks ..
Posted: 2010-03-18 08:59:24 by yancylent
This is exactly what i was looking for THANKS! Very elegant when applied, before i was using a delete confirm page, way too much overhead.
Posted: 2010-12-03 12:43:48 by Phil
Works great! Thanks a million!
Subscribe to the comments for this article
Post your comment for the Delete Confirmation using Javascript article:

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