Hi, I already saw a couple of similar questions to this but I can't figure out what's the problem in my case.
I want to add a required field where a Spotifylink has to be put in before being able to checkout. I generated the field with the UI-elements generator, because I want the field to be matching the theme.
I added this code to my product-template.liquid:
<p class="line-item-property__field"> <label for="spotify-link">Spotify-Link:</label> <input required class="required" id="spotify-link" type="text" name="properties[_Spotify-Link]"> </p>
The "required" option doesn't work at all and it's also a little misplaced since it doesn't match the "Material" option. Also, removing items from the cart genrates an error..
For this store it's necessary to fill out this field, how can I make it work?
I am not afraid to dive into the code by the way, so feel free to even post more complex solutions if it doesn't work on another way.
I dont see it on your product page.
Are you putting it within your main form?
A form is usually depicted by <form>all your code between, add to cart etc</form>
your Add to cart is using AJAX, so it submits the form without changing pages. Which means the required in your input is ignored.
Your options are,
1. disable the popup cart