Automatisches Suchen ohne Submit-Button
This commit is contained in:
parent
324a1c54d6
commit
519dc82023
2
main.go
2
main.go
@ -20,10 +20,10 @@ func main() {
|
|||||||
|
|
||||||
mux.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static/"))))
|
mux.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static/"))))
|
||||||
mux.HandleFunc("/", server.DisplayTable(db))
|
mux.HandleFunc("/", server.DisplayTable(db))
|
||||||
mux.HandleFunc("/submit/", server.SubmitForm(db, &i, &j))
|
|
||||||
mux.HandleFunc("/search/", server.DisplayResults(db))
|
mux.HandleFunc("/search/", server.DisplayResults(db))
|
||||||
mux.HandleFunc("/new-briefing/", server.DisplayForm(&i))
|
mux.HandleFunc("/new-briefing/", server.DisplayForm(&i))
|
||||||
mux.HandleFunc("/add-participant/", server.AddParticipant(&i))
|
mux.HandleFunc("/add-participant/", server.AddParticipant(&i))
|
||||||
|
mux.HandleFunc("/submit/", server.SubmitForm(db, &i, &j))
|
||||||
|
|
||||||
log.Fatalln(http.ListenAndServe(":8080", mux))
|
log.Fatalln(http.ListenAndServe(":8080", mux))
|
||||||
}
|
}
|
||||||
|
@ -19,10 +19,8 @@
|
|||||||
{{ define "content" }}
|
{{ define "content" }}
|
||||||
<form>
|
<form>
|
||||||
<label for="search-input">Suche</label>
|
<label for="search-input">Suche</label>
|
||||||
<input type="text" name="search" id="search-input" />
|
<input type="text" name="search" id="search-input" hx-post="/search/" hx-target="#results" hx-swap="innerHTML"
|
||||||
<button type="submit" hx-post="/search/" hx-target="#results" hx-swap="innerHTML">
|
hx-trigger="keyup changed delay:200ms" />
|
||||||
Suchen
|
|
||||||
</button>
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<form>
|
<form>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user