navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

confirm delete

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> confirm delete
Page: [1]
 
jonance

 

Posts: 298
From: Louisville KY USA
Status: offline

 
confirm delete - 3/25/2001 20:16:00   
Hi,

I have a database that users can add, update, and delete items in. The delete option is a hyperlink going to the page with the sql code to delete the listing with paramaters passed. I need something that will say "Are you sure you want to delete?" before the deletion, giving them a chance to cancel or accept. I tried a couple of scripts but they were on the page with the code and even if you canceled it would send you back to the other page but the item was still deleted. Thanks in advance for your help.

Thanks,

John

Vince from Spain

 

Posts: 658
From: Madrid Spain
Status: offline

 
RE: confirm delete - 3/26/2001 20:39:00   
Hi John,
this simple bit of javascript works for me every time . . .

In the head section . . .

<script language="JavaScript">
<!--
function delrec(id) {
cmsg = "¿Seguro que quiere borrar este archivo?\n"
if (confirm(cmsg)) {
window.location="anotherpage.asp?id=" + id;
}
}
// -->
</script>

Then form your links like . . .
<a href="javascript:delrec('<%=RS("productID")%>')">go to top</a>

I've also illustrated how you could change a Querystring parameter (like anotherpage.asp?rectodelete=45 for instance).

All the best

Vince

------------------
Internet Business Solutions S.L.(Spain)


(in reply to jonance)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> confirm delete
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts