bkuhlmann / form-validator / FormValidator

A customizable form validation component.

This is a wrapper module which exposes public functions, within a single module, found in the sub- modules of this package: - Models - Patterns - Validator - Validators - Views

This wrapper module is provided for convenience in case you don't wish to import the above modules individually. It also serves as a fast way to get up and running quickly via a single import. If this is not desired, you can ignore this module altogether and import the individual sub-modules as needed for your implementation. See the README for details.

Models


type alias Form key =
Models.Form key

Models module wrapper function. See Models module for details.

Init

init : key -> Models.Validators -> Models.Field key

Validator module wrapper function. See Validator module for details.

Accessors

fieldValues : key -> Form key -> List String

Validator module wrapper function. See Validator module for details.

fieldValue : key -> Models.Form key -> String

Validator module wrapper function. See Validator module for details.

fieldErrors : key -> Models.Form key -> Models.Errors

Validator module wrapper function. See Validator module for details.

Updaters

updateValues : key -> Models.Values -> Models.Form key -> Models.Form key

Validator module wrapper function. See Validator module for details.

updateValuesAndValidate : key -> Models.Values -> Models.Form key -> Models.Form key

Validator module wrapper function. See Validator module for details.

updateValue : key -> Models.Value -> Models.Form key -> Models.Form key

Validator module wrapper function. See Validator module for details.

updateValueAndValidate : key -> Models.Value -> Models.Form key -> Models.Form key

Update field value and validate it.

resetForm : Models.Form key -> Models.Form key

Validator module wrapper function. See Validator module for details.

resetField : key -> Models.Form key -> Models.Form key

Validator module wrapper function. See Validator module for details.

updateAndValidateValues : key -> Models.Values -> Models.Form key -> Models.Form key

DEPRECATED: Will be removed in 2.0.0. Use updateValuesAndValidate instead.

Update field values and validate them.

updateAndValidateValue : key -> Models.Value -> Models.Form key -> Models.Form key

DEPRECATED: Will be removed in 2.0.0. Use updateValueAndValidate instead.

Update field value and validate it.

Validators

validateForm : Models.Form key -> Models.Form key

Validator module wrapper function. See Validator module for details.

validateField : key -> Models.Form key -> Models.Form key

Validator module wrapper function. See Validator module for details.

isFormInvalid : Models.Form key -> Basics.Bool

Validator module wrapper function. See Validator module for details.

isFieldInvalid : key -> Models.Form key -> Basics.Bool

Validator module wrapper function. See Validator module for details.

isBlank : Models.Value -> Models.Error

Validators module wrapper function. See Validators module for details.

isEmpty : Models.Value -> Models.Error

Validators module wrapper function. See Validators module for details.

isInteger : Models.Value -> Models.Error

Validators module wrapper function. See Validators module for details.

isFloat : Models.Value -> Models.Error

Validators module wrapper function. See Validators module for details.

isIncluded : List String -> Models.Value -> Models.Error

Validators module wrapper function. See Validators module for details.

isExcluded : List String -> Models.Value -> Models.Error

Validators module wrapper function. See Validators module for details.

isGreaterThan : Basics.Int -> Models.Value -> Models.Error

Validators module wrapper function. See Validators module for details.

isGreaterThanEqualTo : Basics.Int -> Models.Value -> Models.Error

Validators module wrapper function. See Validators module for details.

isLessThan : Basics.Int -> Models.Value -> Models.Error

Validators module wrapper function. See Validators module for details.

isLessThanEqualTo : Basics.Int -> Models.Value -> Models.Error

Validators module wrapper function. See Validators module for details.

isBetween : Basics.Int -> Basics.Int -> Models.Value -> Models.Error

Validators module wrapper function. See Validators module for details.

isLengthGreaterThan : Basics.Int -> Models.Value -> Models.Error

Validators module wrapper function. See Validators module for details.

isLengthGreaterThanEqualTo : Basics.Int -> Models.Value -> Models.Error

Validators module wrapper function. See Validators module for details.

isLengthLessThan : Basics.Int -> Models.Value -> Models.Error

Validators module wrapper function. See Validators module for details.

isLengthLessThanEqualTo : Basics.Int -> Models.Value -> Models.Error

Validators module wrapper function. See Validators module for details.

isLengthBetween : Basics.Int -> Basics.Int -> Models.Value -> Models.Error

Validators module wrapper function. See Validators module for details.

isEmail : Models.Value -> Models.Error

Validators module wrapper function. See Validators module for details.

Views

viewField : key -> Models.Form key -> List String -> List (Html message) -> Html message

Views module wrapper function. See Views module for details.

viewErrors : Models.Errors -> Html message

Views module wrapper function. See Views module for details.

viewError : Models.Error -> Html message

Views module wrapper function. See Views module for details.