Prevent submitting empty input

This commit is contained in:
2024-12-02 13:55:19 -08:00
parent 3aa0714f3a
commit c2b729b051

View File

@@ -61,7 +61,7 @@ fn index() -> Response {
main {
h1 { "To-do" }
form hx-post="/add" hx-target="#list" hx-swap="innerHTML" hx-on:submit="this.elements.task.value = ''" {
input type="text" name="task" placeholder="Task";
input type="text" name="task" placeholder="Task" required;
input type="submit" value="Add";
}
ul id="list" {