Repository navigation
Shopify contact form not confirming submission? Show real success and error states #27
vistabylara-dev
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
إذا ضغط العميل على إرسال ولم يرَ تأكيداً واضحاً، فقد يكرر الطلب أو يغادر. هذا المثال يعرض حالة الإرسال التي يعيدها Shopify، مع توضيح أن نجاح الإرسال لا يثبت وصول الرسالة إلى البريد.
Free Shopify code series · 24/50 · Reviewed 24 October 2026
Contact form not confirming submission?
A button click is not proof that a customer's enquiry was submitted. A custom form can hide validation errors or display a thank-you message too early. Use Shopify's contact form and its returned success/error state.
If Shopify reports success but the merchant receives no email, investigate delivery separately. Changing the button text cannot repair mailbox routing or filtering.
Placement and precautions
Duplicate your theme and use its unpublished preview. Save the original contact section. Replace only the existing custom form markup with this fragment inside a section file; preserve the surrounding section schema and layout. Do not nest it inside another form.
Render this example once per section: its IDs use section.id. Repeating it inside the same section would require an additional unique suffix. If a form app controls the page, use that app's documented integration instead.
Liquid fragment, not a complete section file:
{% assign contact_id = 'VblContact-' | append: section.id %} {% form 'contact', id: contact_id %} {% if form.posted_successfully? %} <p role="status">{{ 'vbl_contact.success' | t }}</p> {% elsif form.errors %} <div role="alert">{{ form.errors | default_errors }}</div> {% endif %} <p> <label for="{{ contact_id }}-email">{{ 'vbl_contact.email' | t }}</label> <input id="{{ contact_id }}-email" type="email" name="contact[email]" autocomplete="email" value="{{ form.email | escape }}" required > </p> <p> <label for="{{ contact_id }}-body">{{ 'vbl_contact.message' | t }}</label> <textarea id="{{ contact_id }}-body" name="contact[body]" rows="6" required>{{ form.body | escape }}</textarea> </p> <button type="submit">{{ 'vbl_contact.send' | t }}</button> {% endform %}Merge the following object into the root of locales/en.default.json, retaining all existing keys and valid commas. Do not replace the entire file or add a second root object. Translate these keys in every active language file.
{ "vbl_contact": { "success": "Thank you. Your message was submitted.", "email": "Email", "message": "Message", "send": "Send message" } }What the code changes
The email field uses the required contact[email] name. The form shows Shopify's success state or default server error messages, while the browser checks the required email and message fields. Submitted text is escaped when displayed again.
The form uses the normal submission flow. It does not add a custom Ajax handler, CRM integration, file upload, newsletter subscription or conversion event. Preserve Shopify's existing challenge/spam protections and the theme's required platform scripts.
Test the complete enquiry journey
Validation: The Liquid fragment and locale JSON passed Shopify's validation tool. No live store submission, inbox-delivery test or browser accessibility test was performed for this guide. Those checks must happen in your store before publishing a change.
Rollback
Restore the saved form markup if the preview fails. Remove only unused translation keys introduced by this example. Keep the previous working theme available. Reverting markup does not remove messages already submitted.
Need help finding where enquiries are being lost?
Send Dr Lara your store URL, theme or form-app name, and whether the customer sees success, an error, or no response. Please remove customer details, passwords and tokens from screenshots.
Start with free guidance and a free initial consultation. Implementation is separately scoped and priced before work begins.
Explore Shopify repairs and development with Vista by Lara
WhatsApp Dr Lara about a Shopify contact-form problem or call +971 50 799 4292.
Free guidance. No commitment. Practical implementation is separately scoped.
Official references
Dr Lara · Vista by Lara · Dubai, UAE
All reactions