formz/field

A Field is the first argument needed to add a field to a form. It contains information about this specific field, like it’s name, label, or (optional) help_text.

Types

pub type Field {
  Valid(
    name: String,
    label: String,
    help_text: String,
    disabled: Bool,
    required: Bool,
    hidden: Bool,
    value: String,
  )
  Invalid(
    name: String,
    label: String,
    help_text: String,
    disabled: Bool,
    required: Bool,
    hidden: Bool,
    value: String,
    error: String,
  )
}

Constructors

  • Valid(
      name: String,
      label: String,
      help_text: String,
      disabled: Bool,
      required: Bool,
      hidden: Bool,
      value: String,
    )
  • Invalid(
      name: String,
      label: String,
      help_text: String,
      disabled: Bool,
      required: Bool,
      hidden: Bool,
      value: String,
      error: String,
    )

Functions

pub fn field(named name: String) -> Field
pub fn make_disabled(field: Field) -> Field
pub fn make_hidden(field: Field) -> Field
pub fn set_disabled(field: Field, disabled: Bool) -> Field
pub fn set_error(field: Field, error: String) -> Field
pub fn set_help_text(field: Field, help_text: String) -> Field
pub fn set_hidden(field: Field, hidden: Bool) -> Field
pub fn set_label(field: Field, label: String) -> Field
pub fn set_name(field: Field, name: String) -> Field
pub fn set_raw_value(field: Field, value: String) -> Field
Search Document