Skip to content

Modify form input names #3824

Open
Open

Description

@derjoergbode

Hello everyone,
I've been trying for hours to find out how I can change the name of a field within a form.

In a regular form, the name is rendered in a data[] array. But I can't use that because I want to make a POST request to a newsletter software that explicitly searches for certain names in the form for further processing.

I have already found a solution for a hidden field by copying the template and then using

{% if field.naked %}
{% set field_name = field.name |fieldName %}
{% else %}
{% set field_name = (scope ~ field.name)|fieldName %}
{% endif %}

have built in. This also works as I need it to. However, I can't figure out how and where to realise this with other fields such as text or email.

Is there a way that the names can be defined in an input field?

Translated with DeepL.com (free version)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions