Clear textarea after sending

This commit is contained in:
Adrien Bouvais 2024-05-11 17:23:50 +02:00
parent 95a58f0f4b
commit af287b8f49
2 changed files with 14 additions and 4 deletions

View File

@ -58,8 +58,12 @@ func main() {
app.Get("/callbackSignup", handleCallbackSignup)
app.Get("/test", func(c *fiber.Ctx) error {
fmt.Println("Current User: ", getCurrentUser(), " - ", checkIfLogin())
return c.Render("test", fiber.Map{})
fmt.Println("Hello from test")
return c.SendString("")
})
app.Get("/empty", func(c *fiber.Ctx) error {
return c.SendString("")
})
// Start server

View File

@ -14,7 +14,7 @@
<button {% if not IsLogin or not HaveKey %}disabled{% endif %} type="submit"
class="send-button button is-primary is-small" hx-post="/requestMultipleMessages"
hx-swap="beforeend settle:200ms" hx-target="#chat-messages" id="chat-input-send-btn"
class="chat-input" hx-include="[name='message'], [name^='model-check-']">
class="chat-input" hx-include="[name='message'], [name^='model-check-']" onclick="clearTextArea()">
<span class="icon">
<i class="fa-solid fa-chevron-right"></i>
</span>
@ -22,4 +22,10 @@
</div>
</div>
</div>
</div>
</div>
<script>
function clearTextArea() {
document.querySelector('.textarea').value = '';
}
</script>