exhal v8.2.0 ExHal.FormField
Functions for working with HAL form fields.
Link to this section Summary
Functions
Create a new form field from parsed form json.
Returns a form field with the specified value.
Link to this section Types
Link to this type
field_types()
field_types()
field_types() ::
:boolean
| :string
| :number
| :date
| :time
| :datetime
| :sensitive
| :hidden
| :text
| :email
| :tel
| :file
field_types() :: :boolean | :string | :number | :date | :time | :datetime | :sensitive | :hidden | :text | :email | :tel | :file
Field types.
Link to this type
field_value()
Possible value types.
Link to this type
t()
t()
t() :: %ExHal.FormField{
name: String.t(),
path: String.t(),
type: field_types(),
value: field_value()
}
t() :: %ExHal.FormField{ name: String.t(), path: String.t(), type: field_types(), value: field_value() }
A HAL form field.
Link to this section Functions
Link to this function
from_field_entry(a_map)
from_field_entry(a_map)
from_field_entry(%{}) :: ExHal.FormField.t()
from_field_entry(%{}) :: ExHal.FormField.t()
Create a new form field from parsed form json.
Raises ArgumentError
if json is invalid.
Link to this function
set_value(field, new_value)
set_value(field, new_value)
set_value(ExHal.FormField.t(), field_value()) :: ExHal.FormField.t()
set_value(ExHal.FormField.t(), field_value()) :: ExHal.FormField.t()
Returns a form field with the specified value.
Raises ArgumentError
if the new value is the wrong type.