PrimerLive.FieldState (PrimerLive v0.7.2)
State object with validation data for a particular form field.
Struct fields:
caption
- Field hint message that may be rendered dependent on the field state.changeset
-Ecto.Changeset
struct.field_errors
- Changeseterrors
, filtered for the field.ignore_errors?
- Changeset has errors but should not be displayed (currently whenchangeset.action
isnil
)message_id
- Generated id that is used foraria_describedby
.message
- Default message derived from changeseterrors
, unless overridden byvalidation_message
attribute.required?
- True if the field is marked as required in the changeset (thechangeset.errors
contains value[validation: :required]
).valid?
- True if changeset'sfield_errors
is empty for the field.