FROM CACHE - en_header

Live Theme - form.errors not appearing on Customer form submission

6 0 5

Howdy all!

I have a client site I've been working on, and am using the following code block on the registration form:



  {% if form.errors %}
    <div class="w-full lg:px-3">
      <div class="errors lg:py-1 xs:mb-0 lg:mb-0">
        <ul class="font-normal">
          {% for field in form.errors %}
              {% if form.errors.messages[field] contains 'associated' %}
                This email address is already associated with an account. If this account is yours, please try <a href="/account/login#recover" class="underline">resetting your password</a>. Or <a href="/account/login" class="underline">Sign In</a>
              {% else %}
                {{ form.errors.messages[field] }}
              {% endif %}
          {% endfor %}
  {% else %}
    <input type="hidden" name="return_to" value="/account" />
  {% endif %}

Use case:
A customer is in the system (either from a previous purchase, migration, or simply manual creation by the site admin), but has no account. They go through the "Registration" flow to create an account, using an email that is already logged in Shopify.

Expected behavior: User is shown a message (which is technically an "error" in Liquid) that essentially says "Account exists. Check your email for an activation code". 

Actual behavior: User is directed to the /account page using our "return_to" input that is only rendered in the Liquid in the absence of form errors.

In other words, it seems like form.errors is not being rendered properly on the live site.


Live Theme (post-submission)

Redirects me to the /account page with no messaging/errors output.

Dev Theme (post-submission) (running locally)



Thanks for any insight here! I figured this might be Shopify server related.


Replies 2 (2)
Shopify Partner
3 0 3



The issue seems occur to be when a form contains a return_to input, such as:



<input type="hidden" name="return_to" value="/account" />



Since the form errors require their respective template path to load (e.g. account/register), the return_to field prevents that path (and its errors) from loading.


I tested the following with no success:


<input type="hidden" name="return_to" value="/account/register" />





New Member
1 0 0

Bump. Same problem here.