I've got a really simple function I want to create, a confirm delete function that is applied to all links with a class of delete. A confirm message appears when the link is clicked, returning false if cancel is clicked.
This is my code and for whatever reason that I just don't get (coz I'm a bit confused by all this stuff), clicking cancel when the confirm message appears seems to return true regardless.
<a href='/admin/video.php?deletevid=1' class='delete'>Delete</a>
var confirmDelete =
var links = Core.getElementsByClass("delete");
for (i = 0; i < links.length; i++)
Core.addEventListener(links[i], "click", confirmDelete.deleteListener);
return confirm("Are you sure you want to delete?")
How do I get this thing to return false, it's got to be somthing simple.