Inserting a required field on product page

Highlighted
New Member
2 0 0

Hi everyone. I need to insert a required field box when customers are on a product page. Currently the field box is there but I want to change it so that it is a requirement to fill it in. The code right now is:

<div>
<label for="giftnote">Gift note</label>
<textarea rows="2" id="giftnote" type="text" name="properties[Giftnote]" placeholder="Please write gift note here or NONE if not need" required="required">{% if form.body %}{{ form.body }}{% endif %}</textarea>
</div>

 

Putting the "required" code doesn't make a difference; when the customer clocks add to cart, it allows if rather than prompting them to fill in the box. 

 

How do I get the gift note box to be required? Thanks!

0 Likes
Highlighted
Shopify Partner
1023 214 464

@CLC89 

 

Send me your srore URL so I can check and assist you better.

 

Thank you,

Tejas

Shopify Expert | Skype: tejas.nadpara
- Like and Mark as an Accepted Solution if reply helpful
- Feel free to contact me on support@hexaecommerce.com regarding any help
0 Likes