ozmat/elm-forms/2.0.0

NOTE: this package is not compatible with Elm 0.19.1

Forms.Form

Form is the top level type of the library. It is built with Fields and a Validate function

Forms

type alias Form comparable err a =
Form comparable err a

A Form is made up of Fields and a Validate function

Fields comparable
-> Validate comparable err a
-> Form comparable err a

Creates a Form

form someFormFields someFormValidate
validate : Form comparable err a -> FormResult comparable err a

Validates a Form. This runs the validation process and returns a FormResult

Field getters and setters

Sometimes you might need to get or set the current value of a Field. That is what those functions are for

getStringField : comparable -> Form comparable err a -> Maybe String

Gets the value of a string Field (input/select)

getBoolField : comparable -> Form comparable err a -> Maybe Bool

Gets the value of a bool Field (checkbox)

comparable
-> String
-> Form comparable err a
-> Form comparable err a

Sets the value of a string Field

setBoolField : comparable -> Bool -> Form comparable err a -> Form comparable err a

Sets the value of a bool Field