[thelist] js alert to confirm deletion

Phil Essing essing at vdl2.com
Tue Sep 24 16:04:00 CDT 2002


Dunstan,

This should do what you need:

<script language="JavaScript" TYPE="text/javascript">
<!--//
	function confirmDelete(deleteLink) {

	if (confirm('Are you really, really, really sure you want to
delete this beautiful image?')) {
		location = deleteLinklink;
		}
	}

//-->
</script>


<a href="javascript:confirmDelete('$current_url&amp;DelPic=$imageid');"
title="Delete this image">delete</a>

Cheers!

-phil

------------------------------------------------------------------------
-----------------
Phil Essing
User Interface Specialist
essing at vdl2.com

VDL2 inc.
700, rue Wellington  .  Montreal, QC  .  H3C 1T4
tel.: 514.599.5712  .  fax: 514.599.5724
------------------------------------------------------------------------
-----------------


> -----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