chore: add validation and debounce to forms

This commit is contained in:
log101 2024-06-22 16:53:51 +03:00
parent 2b9d6d8657
commit 82d2c69e11
2 changed files with 22 additions and 20 deletions

View File

@ -32,7 +32,8 @@ const backendHost = import.meta.env.PUBLIC_BACKEND_HOST;
class="textarea py-2 px-3 w-full box-border"
rows="5"
placeholder="Yazı hakkındaki düşünceleriniz nelerdir?"
name="commentBody"></textarea>
name="commentBody"
required></textarea>
<input
type="text"
class="w-full py-2 px-3 box-border"

View File

@ -16,7 +16,8 @@ const backendHost = import.meta.env.PUBLIC_BACKEND_HOST;
<form
hx-post=`${backendHost}/api/blog/forms/emoji`
hx-target="#reaction-buttons">
hx-target="#reaction-buttons"
hx-trigger="submit delay:0.5s">
<input type="hidden" name="postId" value=`${entryId}` />
<div
id="reaction-buttons"
@ -24,24 +25,24 @@ const backendHost = import.meta.env.PUBLIC_BACKEND_HOST;
hx-trigger="load"
hx-swap="innerHTML">
<div class="emoji-buttons-container">
<button name="emojiInput" value="👍" type="submit" class="emoji-button"
>&nbsp;👍&nbsp;</button
>
<button name="emojiInput" value="👎" type="submit" class="emoji-button"
>&nbsp;👎&nbsp;</button
>
<button name="emojiInput" value="😀" type="submit" class="emoji-button"
>&nbsp;😀&nbsp;</button
>
<button name="emojiInput" value="😑" type="submit" class="emoji-button"
>&nbsp;😑&nbsp;</button
>
<button name="emojiInput" value="🤢" type="submit" class="emoji-button"
>&nbsp;🤢&nbsp;</button
>
<button name="emojiInput" value="👀" type="submit" class="emoji-button"
>&nbsp;👀&nbsp;</button
>
<button name="emojiInput" value="👍" type="submit" class="emoji-button">
&nbsp;👍&nbsp;
</button>
<button name="emojiInput" value="👎" type="submit" class="emoji-button">
&nbsp;👎&nbsp;
</button>
<button name="emojiInput" value="😀" type="submit" class="emoji-button">
&nbsp;😀&nbsp;
</button>
<button name="emojiInput" value="😑" type="submit" class="emoji-button">
&nbsp;😑&nbsp;
</button>
<button name="emojiInput" value="🤢" type="submit" class="emoji-button">
&nbsp;🤢&nbsp;
</button>
<button name="emojiInput" value="👀" type="submit" class="emoji-button">
&nbsp;👀&nbsp;
</button>
</div>
</div>
</form>