[ad_1]
I am creating an ajax request to subscribe to newsletter. The platform is Shopify so its a limited resource available for me to validate if the form is successful or not.
I would like to add a error message if email is already subscribed.
I created an ajax function that post data to Shopify URL /contact#contact_form
.
According to Shopify it does not return any error or message when email is already registered. One thing we can do is just checking if the posted URL has ?contact_posted=true
then it means the form is successful. Otherwise I am assuming email is already registered.
On ajax success function how do I check if the submitted URL has this query string parameter ?contact_posted=true
. Fyi the form action is redirected from /contact#contact_form
to ?contact_posted=true
on success.
Any help would be appreciated.
[ad_2]