You may have noticed that sometimes when filling out a form on a website, there doesn’t appear to be a message to tell you whether the submission was a success or not. 

We have recently found that this is quite prominent on Shopify websites, in particular the newsletter forms which make use of the “customer” form in Shopify. 

When you submit a form in Shopify, a Shopify object called form is returned, which contains the data that the user entered, as well as whether the form was submitted successfully and another object containing the form error messages. 

The form should either be submitted successfully with no errors, or not submitted successfully and a list of the errors will be returned. 

However in some cases there is a third option: the form isn’t submitted successfully but there are no errors. 

Why does this third case occur?

When the user submits a form and it isn’t submitted successfully, the errors object only contains errors relating to the information entered into the form fields by the user. 

If you have a newsletter signup form on your website, the user will be added to your customer list with the email subscription field accepted when they fill in the form, and they will be shown a success message. This third case occurs when they fill in the form again and the email subscription field doesn’t change i.e. they try to subscribe when they are already subscribed. 

The form isn’t submitted successfully, and there are no errors present. There is no other information present in the form object which can be used to detect this issue. 

How do we solve this problem?

If you have access to the code files on your website, and are confident in making changes to the Liquid code inside, then this suggestion could help you display a message to the user when they have already subscribed to your newsletter form. 

We have provided a basic newsletter signup form, which will display all the messages as expected here. This code might not display perfectly on your website, so ask a developer for help if possible to implement it. 

Hopefully our guide will help you with making sure your Shopify newsletter forms are showing error messages correctly. If you have any questions, or are looking at starting a digital project, get in touch with us here at hello@wonderagency.co.uk and we’d be pleased to help.