enbala/elm-form/1.0.0

Form.Field

Read and write field values.

Constructors

type alias Field =

A field is a tree node.

= String String
| Bool Bool
| EmptyField

Form field. Can either be a group of named fields, or a final field.

value : FieldValue -> Field

Build a field from its value.

string : String -> Field

Build a string field, for text inputs, selects, etc.

bool : Bool -> Field

Build a boolean field, for checkboxes.

group : List ( String, Field ) -> Field

Gather named fields as a group field.

list : List Field -> Field

Gather fields as a list field.

Value readers

asString : Field -> Maybe String

Get field value as string.

asBool : Field -> Maybe Bool

Get field value as boolean.