Dynamics 365 plugin 2 identical forms on the same page
-
Hi All,
I have a newsletter sign up form (simple form only 1 input requesting email)
On some pages the form is present 2 to 3 times (twig template form), my problem is when I submit one the others submit also. I have read the docs regarding a unique key but I’m not sure I have added this key correctly. Below is the code for the form, any help would be appreciated.
[msdyncrm_twig] {% form entity="tek__newsandarticle" mode="create" required=["tek__email"] messages={ "success": "Form submitted.", "error": "Submission failed."} key="main-form" %} <form method="POST"> <input class="newsletter-input" name="tek__email" required placeholder="Email"> <button class="newsletter-submit-button" type="submit">Subscribe to our Newsletter</button> <input type="hidden" name="_key" value="{{form.key}}"> {% if form.submission and form.status %} <div class="row twig-success-message"> <div class="col-12"> <div class="alert alert-success"> {{ form.parameters.messages.success ?? "You have been subscribed. Thank you!" }} </div> </div> </div> {% elseif form.submission and (not form.status) %} <div class="row twig-error-message"> <div class="col-12"> <div class="alert alert-danger"> {% if form.parameters.messages.error %} {{ form.parameters.messages.error }} {% else %} {% for descriptor, message in form.errors %} <div>{{ message|join(', ') }}</div> {% endfor %} {% endif %} </div> </div> </div> {% endif %} </form> {% endform %} [/msdyncrm_twig]
We are just testing the free version before we decide to use it and would be buying the premium version and also implementing it on a few other projects ??.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Dynamics 365 plugin 2 identical forms on the same page’ is closed to new replies.