Submit form¶
Available since: 1.0.0
Provided tokens
| Token | Description |
|---|---|
[user] |
The current user. Alias: current_user |
[form] |
The current form. Alias: current_form |
[form:id] |
The form ID. |
[form:base_id] |
The form base ID. |
[form:operation] |
The form operation. |
[form:mode] |
The form mode. |
[form:triggered] |
The form field name that triggered the form event. |
[form:values] |
|
[form:values:FIELD_NAME] |
The field value for each of the named fields. |
[form:num_errors] |
The number of form errors. |
[htmx] |
Information about the current HTMX request. |
[htmx:is_request] |
Whether the current request was sent by HTMX ("1" or "0"). |
[htmx:boosted] |
Whether the current request was boosted by HTMX ("1" or "0"). |
[htmx:history_restore] |
Whether the current request is for HTMX history restoration ("1" or "0"). |
[htmx:target] |
The value of the HX-Target request header. |
[htmx:trigger] |
The value of the HX-Trigger request header. |
[htmx:trigger_name] |
The value of the HX-Trigger-Name request header. |
[htmx:current_url] |
The value of the HX-Current-URL request header. |
[htmx:prompt] |
The value of the HX-Prompt request header. |
[event] |
The event. |
[event:machine_name] |
The machine name of the ECA event. |
[session_user] |
The user account that dispatched the event, regardless if ECA is processing models under a different account. This is only available if ECA is configured to always run under a specific account. |
Fires after the form's own submit handler has run. At this stage, validation has passed and the submitted values are available.
Tip
For entity forms, the [entity] token contains the entity built from submitted form values.
Attention
This event does not provide a render array -- render-array-specific actions are not available during submission.
Fields¶
Restrict by form ID-
The form ID can be mostly found in the HTML <form> element as "id" attribute.
Comma-separated list of form IDs. You can use either the HTML form ID (with hyphens) or the Drupal machine name (with underscores). Matching also works on the base form ID (e.g.,
node_formmatches all node entity forms regardless of bundle). Restrict by entity type ID-
Example: node, taxonomy_term, user
Only fires for entity forms. Restricts to the specified entity type (e.g.,
node,taxonomy_term,user).
Tip
When left empty along with bundle and operation, the event also fires for non-entity forms.
Restrict by entity bundle-
Example: article, tags
Only applies to entity forms. Restricts to the specified bundle (e.g.,
article,tags). Comma-separated for multiple values. Restrict by operation-
Example: default, save, delete
Only applies to entity forms. Restricts to the specified form operation (e.g.,
default,edit,delete). Comma-separated for multiple values.