forms

package
v1.0.117 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Form

type Form struct {
	url.Values
	Errors errors
}

Form is a type holding a genaral form struct including an url.Values object

func New

func New(data url.Values) *Form

New is a function to initialize a form struct

func (*Form) Has

func (f *Form) Has(field string) bool

Has checks for the existence of a form field in the post and ensures is not empty

func (*Form) IsEmail added in v1.0.69

func (f *Form) IsEmail(field string)

IsEmail checks if the value of a field is a valid email address

func (*Form) MinLength added in v1.0.69

func (f *Form) MinLength(field string, length int) bool

MinLength returns false if the field value is shorter than a given length, otherwise true

func (*Form) Required added in v1.0.68

func (f *Form) Required(fields ...string)

Required checks for the existence of form fields in the post and ensures they are not empty

func (*Form) Valid added in v1.0.67

func (f *Form) Valid() bool

Valid returns false in case of errors, otherwise true

Jump to

Keyboard shortcuts

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