bkuhlmann/form-validator/1.2.0

NOTE: this package is not compatible with Elm 0.19.1

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 =
Form key

Models module wrapper function. See Models module for details.

Init

init : key -> Validators -> 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 -> Form key -> String

Validator module wrapper function. See Validator module for details.

fieldErrors : key -> Form key -> Errors

Validator module wrapper function. See Validator module for details.

Updaters

updateValues : key -> Values -> Form key -> Form key

Validator module wrapper function. See Validator module for details.

updateValuesAndValidate : key -> Values -> Form key -> Form key

Validator module wrapper function. See Validator module for details.

updateValue : key -> Value -> Form key -> Form key

Validator module wrapper function. See Validator module for details.

updateValueAndValidate : key -> Value -> Form key -> Form key

Update field value and validate it.

resetForm : Form key -> Form key

Validator module wrapper function. See Validator module for details.

resetField : key -> Form key -> Form key

Validator module wrapper function. See Validator module for details.

updateAndValidateValues : key -> Values -> Form key -> Form key

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

Update field values and validate them.

updateAndValidateValue : key -> Value -> Form key -> Form key

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

Update field value and validate it.

Validators

validateForm : Form key -> Form key

Validator module wrapper function. See Validator module for details.

validateField : key -> Form key -> Form key

Validator module wrapper function. See Validator module for details.

isFormInvalid : Form key -> Bool

Validator module wrapper function. See Validator module for details.

isFieldInvalid : key -> Form key -> Bool

Validator module wrapper function. See Validator module for details.

isBlank : Value -> Error

Validators module wrapper function. See Validators module for details.

isEmpty : Value -> Error

Validators module wrapper function. See Validators module for details.

isInteger : Value -> Error

Validators module wrapper function. See Validators module for details.

isFloat : Value -> Error

Validators module wrapper function. See Validators module for details.

isIncluded : List String -> Value -> Error

Validators module wrapper function. See Validators module for details.

isExcluded : List String -> Value -> Error

Validators module wrapper function. See Validators module for details.

isGreaterThan : Int -> Value -> Error

Validators module wrapper function. See Validators module for details.

isGreaterThanEqualTo : Int -> Value -> Error

Validators module wrapper function. See Validators module for details.

isLessThan : Int -> Value -> Error

Validators module wrapper function. See Validators module for details.

isLessThanEqualTo : Int -> Value -> Error

Validators module wrapper function. See Validators module for details.

isBetween : Int -> Int -> Value -> Error

Validators module wrapper function. See Validators module for details.

isLengthGreaterThan : Int -> Value -> Error

Validators module wrapper function. See Validators module for details.

isLengthGreaterThanEqualTo : Int -> Value -> Error

Validators module wrapper function. See Validators module for details.

isLengthLessThan : Int -> Value -> Error

Validators module wrapper function. See Validators module for details.

isLengthLessThanEqualTo : Int -> Value -> Error

Validators module wrapper function. See Validators module for details.

isLengthBetween : Int -> Int -> Value -> Error

Validators module wrapper function. See Validators module for details.

isEmail : Value -> Error

Validators module wrapper function. See Validators module for details.

Views

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

Views module wrapper function. See Views module for details.

viewErrors : Errors -> Html message

Views module wrapper function. See Views module for details.

viewError : Error -> Html message

Views module wrapper function. See Views module for details.