Checking for registration errors

New Member
7 0 0

I have modified the behavior of the customer register form so that it goes to a different landing page.  However, if there is an error on the form, the error checking routines no longer work.

 

Each input field has  code similar to this:

 

<div class="input-wrapper">
<label for="customer[last_name]">{{ 'customer.addresses.last_name' | t }}</label>
<input class="input-field {% if form.errors contains 'last_name' %}error{% endif %}" type="text" value="{{ form.last_name }}" name="customer[last_name]">
</div>

 

If errors are detected, the user is supposed to be returned to the registration form after the recaptcha dialog.  However, my code is overriding that error checking and sending the user to the landing page.

 

Is there a way to check for the "form.errors" value from the registration form  or from the recaptcha dialog when a page is loading (presumably with javascript in the theme header) or otherwise to capture the form.errors value?

 

I have determined that the recaptcha token $('#g-recaptcha') is an HTML Div element with this debuggin code:

console.log($('#g-recaptcha')[0])  which results in  "[object HTMLDivElement]".

 

Any help would be greatly appreciated.

 

Thanks.

0 Likes
Shopify Partner
15 0 6

Bump. I am having this same exact issue.

0 Likes
Excursionist
13 1 2

The form does get processed on the Shopify side, you can adjust the form to not redirect until successfully processed via JS.

Need shopify help? Drop us an email hi@cnvs.la
Web: www.cnvs.la
0 Likes
Shopify Partner
15 0 6

Hi that sounds great... how would I go about doing that?

 

 

0 Likes