canceraiddev / elm-form-builder / Form.Validate.Types

Types used for validation.

Validate


type alias Validator =
Form.Locale.Locale -> Form.Field.StringField -> Result StringFieldError Form.Field.StringField

API for validating StringFields (already with just the value of the field)

Error Messages


type alias ErrorToMessage =
Form.Locale.Locale -> Form.Field.StringField -> StringFieldError -> String

API for localised error messages


type StringFieldError
    = RequiredError
    | InvalidOption
    | InvalidMobilePhoneNumber
    | InvalidPhoneNumber
    | InvalidEmail
    | InvalidDate
    | InvalidUrl
    | RegexIncongruence String

Error messages that can be produced or displayed for a StringField