Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify form input names #3824

Open
derjoergbode opened this issue Apr 25, 2024 · 0 comments
Open

Modify form input names #3824

derjoergbode opened this issue Apr 25, 2024 · 0 comments

Comments

@derjoergbode
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant