Skip to content

Commit dcca088

Browse files
committed
allow enter to submit password
1 parent 2df7e4c commit dcca088

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

web/password.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@
5454
</div>
5555
</div>
5656

57-
<form id="content" class="content" hx-swap-oob="true" hx-include="[name='pastePassword']">
57+
<form id="content" class="content" hx-swap-oob="true" hx-get="/htmx/fetch" hx-target="#pastecontainer"
58+
hx-vals="js:{id: window.location.pathname, noReload: 'true'}" hx-include="[name='pastePassword']"
59+
hx-trigger="keyup[keyCode==13]" onSubmit="return false;">
5860
<div id="pastecontainer" class="pasteContainer">
5961
<div class="protected">
6062
<h1>Password Protected!</h1>
@@ -63,7 +65,8 @@ <h1>Password Protected!</h1>
6365
maxlength="100" type="password" autocomplete="off" />
6466
<span id="errorResponse" style="display: none;"></span>
6567
<span class="savePaste" hx-get="/htmx/fetch" hx-target="#pastecontainer"
66-
hx-vals="js:{id: window.location.pathname, noReload: 'true'}">Submit</span>
68+
hx-vals="js:{id: window.location.pathname, noReload: 'true'}"
69+
hx-include="[name='pastePassword']">Submit</span>
6770
</div>
6871
</div>
6972
</form>

0 commit comments

Comments
 (0)