Skip to main content

Email

What is the Form Email?​

With the email form type you can input an email address, and its format is checked automatically as you type.

email.png

Options​

Note

There are no type-specific options for Email.

Setting Mock Field and Own Value​

  • Writing only happens in the displayer; in the editor it is disabled.
  • On each write the field calls the SDK to set its own value and writes its value to the bound form-output datasource (with no extra properties).
  • Writes are debounced by 200 ms.
  • A write is triggered when:
    • The widget is rendered.
    • The input loses focus (on blur).
    • An external message updates the field.
  • Note: typing does not write to the Mock on every keystroke; while typing, only validation is updated. The value is committed on blur.

Validation​

The email is checked against an email-format pattern on every input change.

  • If the value matches the pattern, the field is valid and any error is cleared.
  • If the value does not contain an @ symbol, the field is invalid with the message Email does not includes @ symbol.
  • If the value contains @ but is otherwise malformed, the field is invalid with the message Invalid email address!
  • An empty value clears the validation state and any error.
  • How the result is surfaced depends on the common Error settings:
    • Validate Field must be enabled for the validity to be written to the form summary and for the {FORM-NAME}-valid sensor event to be sent.
    • Show Validation adds a colored border indicating validity.
    • Show error messages displays the error text under the field while the value is invalid.

Sensor Events​

The email field can send two sensor events. {FORM-NAME} is the name assigned to the field.

  • {FORM-NAME}

    • Value: the current field value.
    • Triggered each time the field writes to the Mock datasource (render, blur, external message), unless the triggering external command is a silent one.
  • {FORM-NAME}-valid

    • Value: true or false, the result of validation.
    • Triggered only when Validate Field is enabled, after each validation check (debounced 150 ms).

External Messages​

The email field listens to the basic form commands:

  • Set Form: reads the value parameter from the message. If it is missing or not a string, the input is cleared; otherwise the input is set to that value. The value is then validated and written to the Mock and own value.
  • Reset Form / Clear Form: empty the input and update the validation, Mock, and own value.
  • The silent variants (silentResetForm, silentClearForm) do the same but suppress the value sensor event.

Value from Datasource​

The email field does not accept a list of options from a datasource. On render it reads any existing value stored under its field name in the bound form-output datasource and pre-fills the input with it.