Prevent submitting empty input
This commit is contained in:
@@ -61,7 +61,7 @@ fn index() -> Response {
|
|||||||
main {
|
main {
|
||||||
h1 { "To-do" }
|
h1 { "To-do" }
|
||||||
form hx-post="/add" hx-target="#list" hx-swap="innerHTML" hx-on:submit="this.elements.task.value = ''" {
|
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";
|
input type="submit" value="Add";
|
||||||
}
|
}
|
||||||
ul id="list" {
|
ul id="list" {
|
||||||
|
Reference in New Issue
Block a user