Confirm before deleting a post

main
Brian Picciano 9 months ago
parent e8a1f51fb6
commit 0bc9cd83b4
  1. 12
      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>

Loading…
Cancel
Save