Documentation
¶
Overview ¶
Package validation enables your handler to return validation errors. Each validation error is displayed by the corresponding input.Input field: - the input switches to style.StyleInvalid - the error message is displayed below the field
Handler code:
_ = validation.Retarget(r.Context(), validation.D{
FormID: "profile",
Errors: map[string]string{"Email": "Email is mandatory"},
}, w, http.StatusUnprocessableEntity)
Template code:
@form.C(form.D{ID:"profile"}) {
@input.C(input.D{Name: "Email", Type: input.TypeEmail})
}
templ: version: v0.2.793
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddvalidationStory ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.