add gender in registration form

Solved
Tourist
6 0 2

Hi i want to create a " Select Gender " in my registration form .

 

I tried the forms , but the data did not enter into my shopify customer link . 

 

Can anyone guide me on my error message ? i need help and guide thanks

 

Script : 

 

Gender
      <label for="gender" class="label--hidden">{{ 'customer.register.gender' | t }}</label>
    <input type="radio" id="gender" value="male" placeholder="{{ 'customer.register.gender' | t }}" {% if form.male %}value="{{ form.male }}"{% endif %}> Male
    <input type="radio" id="gender" value="female" placeholder="{{ 'customer.register.gender' | t }}" {% if form.female %}value="{{ form.female }}"{% endif %}> Female<br><br><br>
0 Likes

Success.

Shopify Expert
2 1 0

Hi there,

 

I see your forgot add "name" attribute to HTML code. 

This should be correct:

<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>

Good luck :)

0 Likes
Tourist
6 0 2

Looks great ! It works well.

 

Thanks !


@globosoftware wrote:

Hi there,

 

I see your forgot add "name" attribute to HTML code. 

This should be correct:

<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>

Good luck :)


 

1 Like
Highlighted
New Member
1 0 0

I need to fetch the customer note that has saved in  my liquid file later to display the details. Please let me know is it possible

0 Likes