web form errors

This block is part of the web group and was last modified in core v15.0.1.

web form errors v15.0.1

Shows validation messages next to the fields of the form that sent the action. The browser clears a message as soon as the field is edited.

In pins 3 + flow
  • flow
  • errors object

    Field name → message.

  • message value

    A message for the whole form.

  • form value

    A CSS selector for the form, when not the one that sent the action.

Out pins 0 + flow
  • flow

Adds a browser update to the web action's answer: for every {field name: message} in `errors` the form's field gets aria-invalid and the message is written into the element [data-error-for="<name>"] in the form (created after the field when missing); `message` goes to [data-error-for="_form"]. Empty messages are dropped; an empty errors object clears earlier messages. The form is the one that sent the action unless `target` selects another. Only in a flow started by web_action. The browser runtime also checks required/minlength/pattern/type=email itself before sending, so the server only sees forms that pass those.

validation errors
field errors
form validation

The browser checks required fields and formats itself, so the action only has to check what the server alone can know. The email from the form feeds a search single, and when it finds a subscriber the branch runs web form errors. Its errors pin is an object of field name to message, built here with key -> value, and the browser writes the message next to that field of the form that sent the action. The message pin is for the form as a whole. The false pin of the branch would carry on and store the address.

Studio canvas example for the web form errors block: refusing an address that is already on the list.

Used in these guides

These documentation pages use or explain this block:

Version history

Introduced in v15.0.1.

  • v15.0.1: block added in this release.

Back to web Return to the main group to view all sub-groups Back to web actions Return to the group to view all blocks within this group