diff --git a/appview/pages/htmx.go b/appview/pages/htmx.go
index 059e28bf..0f6b14ae 100644
--- a/appview/pages/htmx.go
+++ b/appview/pages/htmx.go
@@ -4,6 +4,7 @@ import (
"fmt"
"html"
"net/http"
+ "strings"
)
// Notice performs a hx-oob-swap to replace the content of an element with a message.
@@ -25,6 +26,18 @@ func (s *Pages) NoticeHTML(w http.ResponseWriter, id string, trustedHTML string)
w.Write([]byte(markup))
}
+func (s *Pages) NoticeHTMLWithClears(w http.ResponseWriter, id string, trustedHTML string, clearIDs ...string) {
+ var b strings.Builder
+ b.WriteString(fmt.Sprintf(`%s`, id, trustedHTML))
+ for _, clearID := range clearIDs {
+ b.WriteString(fmt.Sprintf(``, clearID))
+ }
+
+ w.Header().Set("Content-Type", "text/html")
+ w.WriteHeader(http.StatusOK)
+ w.Write([]byte(b.String()))
+}
+
// HxRefresh is a client-side full refresh of the page.
func (s *Pages) HxRefresh(w http.ResponseWriter) {
w.Header().Set("HX-Refresh", "true")
diff --git a/appview/signup/signup.go b/appview/signup/signup.go
index fb52f7a5..ee51d402 100644
--- a/appview/signup/signup.go
+++ b/appview/signup/signup.go
@@ -332,9 +332,9 @@ func (s *Signup) executeSignupTransaction(ctx context.Context, username, passwor
// if we get here, we've successfully created the account and added the email
success = true
- s.pages.NoticeHTML(w, "signup-msg", fmt.Sprintf(`Account created successfully. You can now
+ s.pages.NoticeHTMLWithClears(w, "signup-msg", fmt.Sprintf(`Account created successfully. You can now
login
- with %s.tngl.sh.`, username))
+ with %s.tngl.sh.`, username), "signup-error")
// clean up inflight signup asynchronously
go func() {