Understanding form.posted_successfully

New Member
1 0 0

Could someone explain exactly how the form.posted_successfully function works?

I am trying to trigger a register user event, however when clicking on “submit”, I am unable to verify that the form was indeed successfully submitted. For example, I tried adding the following code snippet within the relevant form in customers/register.liquid:

{%- if form.posted_successfully? -%}
<script>console.log("check if submitted");</script>
{%- endif -%}


However, nothing happened when I was added as a user since I couldn’t see a message in the console. Could you please guide me as to how the output of this function should look like? Or alternatively, how to trigger an event on the client’s side once a user was successfully added (server side).

Shopify Partner
482 86 121

Did you put that code inside form ? It should work, it will not work if you put it outside of {% form .... %}

Author: Hovhannes Sargsyan (aka sarhov).
An individual web developer focused on Shopify development.
Need more help? Feel free to send me a direct message or drop an email shopify@sarhov.com

Website: https://sarhov.com  
Email: shopify@sarhov.com
Skype: @sarhov
Telegram: @sarhov
Try Shopify free for 14 days,

the logic would be:

if current_url contains


then success == true

so just add ?customer_posted=true onto your url to see what customer will see / test with


this doesn't appear to be working 100% of the time for me since captch was introduced - client reported to me
however after having a play around and it seems like it does work after captcha but only if the email is valid and not already added

just test at end with valid email


★★★ Need help setting up your Shopify store? Hire me here: https://liquify.design ★★

If you still require assistance with this issue then please visit https://yakety.co.uk and submit a development request.

Matthew Anderson | Managing Director | +44 20 3920 8081 |  support@yakety.co.uk |  https://yakety.co.uk | Facebook | Twitter | Instagram