Fix form validation not working

If the product can be added to the cart without entering all the required values, follow the steps below.

In some cases the form validation is executed after instead of before the themes cart functionality.

To fix this, add a DIV with the attribute "data-live-validate" around your specific "Add to cart" button:

<div data-live-options="{{ product.id }}"></div>

<div data-live-validate>

<button type="submit" name="add">Add to cart</button>

</div>


Important:  Make sure that the options container DIV is outside of the "data-live-validate" DIV. 

After you've completed this setup, the validation should get executed before the add to cart functionality. 

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.