Add query param autofill to form

This commit is contained in:
2024-08-04 08:49:58 -04:00
parent 1156cabe05
commit 1fcbac610f
2 changed files with 15 additions and 1 deletions

View File

@@ -16,10 +16,15 @@ type Users struct {
}
func (u Users) New(w http.ResponseWriter, r *http.Request) {
u.Templates.New.Execute(w, nil)
var data struct {
Email string
}
data.Email = r.FormValue("email")
u.Templates.New.Execute(w, data)
}
func (u Users) Create(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "TODO! ", r.FormValue("email"))
}
func FromStaticTemplate(templatePath ...string) Users {