• Resolved derekbolger2022

    (@derekbolger2022)


    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]

    Documentation Links https://docs.alexacrm.com/wpcrm/twig/

Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Alexa CRM plugin 2 identical forms on the same page’ is closed to new replies.