diff options
author | Brian Picciano <mediocregopher@gmail.com> | 2023-08-13 21:42:27 +0200 |
---|---|---|
committer | Brian Picciano <mediocregopher@gmail.com> | 2023-08-13 21:42:27 +0200 |
commit | 0bc9cd83b45df0a38c2944569603d6d9cf2e9edd (patch) | |
tree | f6b6e5b27ef6ccab0c4e3213b0fc827b32bd8889 /src | |
parent | e8a1f51fb6938dff9feb75c964622420914a6714 (diff) |
Confirm before deleting a post
Diffstat (limited to 'src')
-rw-r--r-- | src/http/tpl/posts-manage.html | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/http/tpl/posts-manage.html b/src/http/tpl/posts-manage.html index ac781df..96b30ca 100644 --- a/src/http/tpl/posts-manage.html +++ b/src/http/tpl/posts-manage.html @@ -1,4 +1,10 @@ {{ define "body" }} + <script> + function confirmDelete(event) { + if (!confirm("Are you sure you want to delete this post?")) + event.preventDefault(); + } + </script> <p> <a href="{{ BlogURL "admin" }}">Back to Admin</a> @@ -34,7 +40,11 @@ action="{{ PostURL .ID }}?method=delete" method="POST" > - <input type="submit" value="Delete" /> + <input + type="submit" + value="Delete" + onclick="confirmDelete(event)" + /> </form> </td> </tr> |