Form
is the top level type of the library. It is built with Fields
and a Validate
function
Internal.Form comparable err a
A Form
is made up of Fields
and a Validate
function
form : Forms.Field.Internal.Fields comparable -> Forms.Validation.Internal.Validate comparable err a -> Form comparable err a
Creates a Form
form someFormFields someFormValidate
validate : Form comparable err a -> Forms.Validation.Result.FormResult comparable err a
Validates a Form
. This runs the validation process and returns
a FormResult
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 Basics.Bool
Gets the value of a bool Field
(checkbox)
setStringField : comparable -> String -> Form comparable err a -> Form comparable err a
Sets the value of a string Field
setBoolField : comparable -> Basics.Bool -> Form comparable err a -> Form comparable err a
Sets the value of a bool Field