Field

type Field

type Field struct {
    Name  string
    Error *ValidationError
    // contains filtered or unexported fields
}

Field represents a data fieid that may be collected in a web form.

func NewField

func NewField(name string, renderArgs map[string]interface{}) *Field

func (*Field) ErrorClass

func (f *Field) ErrorClass() string

Return ERROR_CLASS if this field has a validation error, else empty string.

func (*Field) Flash

func (f *Field) Flash() string

Returned the flashed value of this field.

func (*Field) FlashArray

func (f *Field) FlashArray() []string

Returned the flashed value of this field as a list.

func (*Field) Id

func (f *Field) Id() string

Returns an identifier suitable for use as an HTML id.

func (*Field) Value

func (f *Field) Value() interface{}

Return the current value of this field.