Date Picker – How do I make it mandatory?

I’m using the Shopify suggested code to add a date picker to my checkout process, however, I can’t seem to make it mandatory. This is the code I have inserted. Can anyone help?

You can add required into input tag.

Instead this:

<input id="date" type="text" name="attributes[date]" value="{{ cart.attributes.date }}" />

Use this code:

<input required id="date" type="text" name="attributes[date]" value="{{ cart.attributes.date }}" />

 

Leave a Reply

Your email address will not be published. Required fields are marked *