Documentation ¶
Overview ¶
Package forms provides support for HTML forms and its input elements.
Index ¶
- type Form
- func (f *Form) Checkbox(fieldName, value string, attributes ...string) *elements.Element
- func (f *Form) Email(fieldName, placeholder string) *elements.Element
- func (f *Form) Error(fieldName string) *elements.Element
- func (f *Form) HasError(fieldName string) bool
- func (f *Form) Input(fieldName, placeholder string, attributes ...string) *elements.Element
- func (f *Form) Number(fieldName, placeholder string, attributes ...string) *elements.Element
- func (f *Form) Option(value, label string) *elements.Element
- func (f *Form) Password(fieldName, placeholder string, attributes ...string) *elements.Element
- func (f *Form) Radio(fieldName, value string) *elements.Element
- func (f *Form) Search(fieldName, placeholder string, attributes ...string) *elements.Element
- func (f *Form) Select(fieldName string, options []*Option) *elements.Element
- func (f *Form) Text(fieldName, placeholder string, attributes ...string) *elements.Element
- func (f *Form) Textarea(fieldName, placeholder string, attributes ...string) *elements.Element
- type Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Form ¶
type Form struct { // ValidationItems is a map of field names and their corresponding // validation.Item. Used to get information about the items’ validation // rules. ValidationItems validation.Items // ValidationMessages contains a validation error message for each form // field that has an invalid value. ValidationMessages validation.Messages // contains filtered or unexported fields }
Form represents an HTML form.
func (*Form) Error ¶
Error returns a <div class="validation-error"> element that contains the validation error message as text.
Click to show internal directories.
Click to hide internal directories.