How to add a gender selection in register form?

NielsSchutte
Explorer
167 2 8

Hi,

I was wondering how to add gender selection in my register form?

I've tried the following code:

<label for="gender" class="label--hidden">{{ 'customer.register.gender' | t }}</label>
    <input name="customer[note][gender]" type="radio" id="gender" value="male" placeholder="{{ 'customer.register.gender' | t }}"> Male
    <input  name="customer[note][gender]" type="radio" id="gender" value="female" placeholder="{{ 'customer.register.gender' | t }}"> Female<br><br><br>

This giving me this error:

Knipsel.PNG

 

Hope someone can help me!

Thanks in advance!

0 Likes
michael-helium
Shopify Expert
232 2 119

Are you using a translation app? That could be the problem here, rather than your code.

Also, have you considered that saving customer gender to the customer note field limits how you can actually use this data? If you want to segment customers by gender or use that data with your marketing tools, try Customer Fields. The app has many advantages over Shopify's workaround (link) such as drag-and-drop form builder (no code), customer directory WITH custom fields, etc.

Cheers,

Michael, Former Director of Business Development @ Helium (view current profile)
- Customer Fields ✪ 4.9/5 (242 reviews)
- Meteor Mega Menu ✪ 4.7/5 (203 reviews)
0 Likes