components

package
v0.0.0-...-c0b8c70 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FormErrorData

type FormErrorData struct {
	FieldErrors map[string][]string
	GlobalError string
	Success     bool
}

FormErrorData represents data for rendering form errors

func NewFormErrorData

func NewFormErrorData(err *pbErrors.StandardError) *FormErrorData

NewFormErrorData creates FormErrorData from a StandardError

func (*FormErrorData) GetFieldClasses

func (f *FormErrorData) GetFieldClasses(field string, baseClasses string) template.HTMLAttr

GetFieldClasses returns CSS classes for a form field based on error state

func (*FormErrorData) GetFieldError

func (f *FormErrorData) GetFieldError(field string) string

GetFieldError returns the first error message for a field

func (*FormErrorData) GetFieldErrors

func (f *FormErrorData) GetFieldErrors(field string) []string

GetFieldErrors returns all error messages for a field

func (*FormErrorData) GetFieldErrorsAsString

func (f *FormErrorData) GetFieldErrorsAsString(field string) string

GetFieldErrorsAsString returns all error messages for a field as a single string

func (*FormErrorData) HasFieldError

func (f *FormErrorData) HasFieldError(field string) bool

HasFieldError checks if a specific field has errors

func (*FormErrorData) HasGlobalError

func (f *FormErrorData) HasGlobalError() bool

HasGlobalError checks if there's a global error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL