On Wed, 18 Feb 2004 20:29:32 +0000, Craig <cr*******@hotmail.com> wrote:
I'm working on a PHP FTP client, but my testers have complained the
delete file link is too easy to hit by mistake. Would it be
possible/plausible to write a bit of javascript that pops up a
confirmation when they click the link, that goes to a certain page if
they click yes and does nothing if they click no?
This is fairly simple to do, but very unreliable: if JavaScript is
disabled, there will be no confirmation option. The best thing to do would
be to list on a new page all of the files and directories that will be
deleted (or a summary of them), then get the user to confirm the deletion
that way.
If you still want to proceed with a JavaScript method:
<a href="delete.php"
onclick="return confirm('Are you sure?');">Delete</a>
Mike
--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)