In article <3fccec0d$0$66032$>,
enlightened us with...
> I would like a small JavaScript to display a warning when a link is pressed
> to ask the user if they are sure they want to follow the link.
>
> This is because I am using the link to delete a record from a database using
> php and mysql.
>
> Any help would be very welcome as I hav never used JavaScript before.
>
This is very dangerous if you don't know your users - they could easily
disable javascript or have non-js text browsers, such as lynx.
My personal way of deleting/updating records involves a confirm page
with a redirect so the users can't refresh or go back and muck things
up.
Anyway...
For modern browsers that support onClick for anchors (NN6/IE5/etc)...
<a href="someUrl" onClick="return confirm('Are you sure?');">link</a>
--
--
~kaeli~
You feel stuck with your debt if you can't budge it.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace