Skip to content

Commit

Permalink
Added onsubmit in cancel form
Browse files Browse the repository at this point in the history
A confirmation dialog was added to the cancel button to prevent immediate cancellation, as the cancel button is located right after the log, which could lead to unintended cancellations by the user.
  • Loading branch information
Naik-G authored May 24, 2024
1 parent 00e30f8 commit 994891c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scrapyd/website.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def __init__(self, root, local_items):
self.prefix_header = root.prefix_header

cancel_button = """
<form method="post" action="{base_path}/cancel.json">
<form method="post" onsubmit="return confirm('Are you sure?');" action="{base_path}/cancel.json">
<input type="hidden" name="project" value="{project}"/>
<input type="hidden" name="job" value="{jobid}"/>
<input type="submit" style="float: left;" value="Cancel"/>
Expand Down

0 comments on commit 994891c

Please sign in to comment.