[thelist] js alert to confirm deletion

Pete Freitag pf at cfdev.com
Tue Sep 24 14:53:08 CDT 2002


this should do the trick...


<script>
function confirmDelete(delUrl) {
	if (confirm("Are you sure you want to delete")) {
		document.location = delUrl;
	}
}
</script>

<a href="javascript:confirmDelete('delete.php...')">Delete</a>

_____________________________________________
Pete Freitag
CTO, CFDEV.COM
http://www.cfdev.com/

-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Dunstan Orchard
Sent: Tuesday, September 24, 2002 3:38 PM
To: evolt list
Subject: [thelist] js alert to confirm deletion


Hi there,

I'm sure this is very simple, but I can't get my brain around it:


I have a link in a PHP page that reloads that page (with all the query
strings
as well) and tacks on an extra query:

<?php
$current_url = $_SERVER['REQUEST_URI'];

...

<a href="$current_url&amp;DelPic=$imageid" title="Delete this
image">delete</a>
?>

And then some logic happens using the DelPic value.


I'd like to put a JS alert in there so that the user has to click on it to
confirm they want the delete to go ahead. And if the click 'NO' then the
page
stays as it was.


Could anyone suggest how to do that? I can't work it out :o/


Thanks very much - dunstan

---------------------------
Dorset, England
http://www.1976design.com/
http://www.orchard.it/
http://www.maccaws.org/
--
For unsubscribe and other options, including
the Tip Harvester and archive of thelist go to:
http://lists.evolt.org Workers of the Web, evolt !




More information about the thelist mailing list