Custom Shopify Attribute in Cart set to "required" is not working

Hi all,

I’ve generated the code which creates the custom cart attribute using this site:

https://ui-elements-generator.myshopify.com/pages/cart-attribute

The box shows up on the cart page as expected.

I selected that the field box must be “Required”, however when testing, customers can still proceed from cart to checkout without having to put any info in the field. It does’t stop the customer and no warning sign/indication is shown.

I am using the Minimal theme.

Is there a solution to this?

Thanks!

Check if the form has the attribute: novalidate

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#attr-novalidate

https://stackoverflow.com/questions/45337792/what-does-the-novalidate-html-attribute-do

If so remove it and thoroughly test your store and theme again.

Beyond that you need to provide a reproducible example for others to inspect that is publicly available or provide the storefront password:

https://community.shopify.com/c/blog/how-to-get-support-from-the-community/ba-p/1399408

1 Like

If the intent is to require customers to agree to TOS terms of service or AUP then also see the advanced customization tutorial

https://community.shopify.com/c/shopify-design/cart-add-an-agree-to-terms-and-conditions-checkbox/td-p/614939

If the intent is to get personalization information PER line item(productVariant) in the cart then use line item properties instead

https://community.shopify.com/c/shopify-design/product-pages-get-customization-information-for-products/td-p/616503

Hi @PaulNewton

I found the novalidate attritube and removed it - it did the trick! It now asks the customer to input their info into the field. See attached photo.

But I did notice one other thing, if the customer clicks on Update Cart, then it also displays this same message. It wont update the cart, the same request message will just pop again.