NOTE: this package is not compatible with Elm 0.19.1
This module contains a form Error type.
Error
Note: You should not need to care about this unless you are writing your own form renderer.
Represents a form error.
It can either be:
RequiredFieldIsEmpty
ValidationFailed
String
These type of errors are returned alongside each field in the Form.fill and Form.Base.fill functions.
Form.fill
Form.Base.fill
You can easily write a simple function that turns this type into a String:
errorToString : Error -> String errorToString error = case error of Error.RequiredFieldIsEmpty -> "this field is required" Error.ValidationFailed errorDescription -> errorDescription
Represents a form error.
It can either be:
RequiredFieldIsEmpty, meaning that a required field is empty.ValidationFailed, meaning the field validation has failed. This type of error contains aStringdescribing the validation error.These type of errors are returned alongside each field in the
Form.fillandForm.Base.fillfunctions.You can easily write a simple function that turns this type into a
String: