Confirm before deleting a post
This commit is contained in:
parent
e8a1f51fb6
commit
0bc9cd83b4
@ -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…
Reference in New Issue
Block a user