Try this:
<cfoutput>
<script language="JavaScript">
<!--
function checkIt(){
if (confirm("WARNING: Pressing OK will permanently delete this record.
\n Are you sure you want to delete it?")) {
location.href="deletepage.cfm?ID=#DID#";
return true;
}
else {
location.href="someotherpage.cfm";
return false;
}
}
//-->
</script>
</cfoutput>
In the "delete" link on the main page, call the function like this:
<a href="deletepage.cfm" onClick="return checkIt();">delete</a>
-Elizabeth
-----Original Message-----
From: Michael [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 14, 2000 3:13 PM
To: CF-Talk
Subject: Delete method
I have the following code on an action page that is being called from a
delete reference on the main page, however I want it so that when the
click the delete, it ask's them are they sure , absolutely sure, and
then delete the record. Right now if I delete, it just goes, and
deletes. I know this is'nt Rocket science but I just dont remember
how the coding goes.
TIA
Michael
<cfquery name="qry_delete_interview" datasource="Interview" username=""
password="" >
DELETE FROM interview
WHERE ID = #URL.DID#
</cfquery>
<CFLOCATION URL="intvlist.cfm">
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists