peterb1985
MIS
I'm trying to write a confirmation box so that when a user clicks ok a delete query is run and if cancel is clicked nothing happens. The code i tried is listed below, which doesn't work, probably because its taken from different books. If anyone knows an easier way or a way that works. please help.
var tmpAction = "";
function checktext() {
if (tmpAction == "delete")
{window.confirm('Are you sure you want to delete contact?');
window.status=(temp)?'confirm: true':'confirm: false';}
return true;}
</script>
<cfif isdefined("form.delete")>
<script language="javascript" >
if (temp == "true")
<cfquery name="delete" datasource="saleswebtest">
delete from markcontacts
where recno='#form.recno#'
</cfquery>
opener.location.href=" window.close();
</script>
</cfif>
Cheers
Pete
If it ain't broke, don't fix it!
var tmpAction = "";
function checktext() {
if (tmpAction == "delete")
{window.confirm('Are you sure you want to delete contact?');
window.status=(temp)?'confirm: true':'confirm: false';}
return true;}
</script>
<cfif isdefined("form.delete")>
<script language="javascript" >
if (temp == "true")
<cfquery name="delete" datasource="saleswebtest">
delete from markcontacts
where recno='#form.recno#'
</cfquery>
opener.location.href=" window.close();
</script>
</cfif>
Cheers
Pete
If it ain't broke, don't fix it!