WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@dev-newvisibility
Copy link
Contributor

@dev-newvisibility dev-newvisibility commented Jul 4, 2023

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
License MIT

What's in this PR?

This PR adds the URL parameter form=<form-id> when a form is submitted in addition to send=true

Why?

At the moment, if you add multiple dynamic forms to the same template, or if multiple forms are displayed on the same page, you can't know which one has been submitted due to the fact that the send=true URL parameter value is the same for all forms.

Example Usage

{% if app.request.get('send') == 'true' and app.request.get('form') == view.form.entity.formId %}
     {{ view.form.entity.successText|raw }}
{% endif %}

@dev-newvisibility dev-newvisibility changed the title Supporting multiple dynamic forms in the same page Supporting multiple dynamic forms on the same page Jul 4, 2023
@dev-newvisibility
Copy link
Contributor Author

We've updated the PR to ensure it is a non-breaking change.

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

Successfully merging this pull request may close these issues.

1 participant