Making note section mandatory (cart attributes) not working!

Hey team!

I am adding this to the cart:

Note for Enclosure Card (if not applicable type N/A) {{ cart.attributes["Note for Enclosure Card (if not applicable type N/A)"] }}

All is well, Except - it is still allowing me to go through to the checkout even when the field is blank! So the mandatory isn’t working.

(theme: debut)

Any suggestions?

Nevermind! Sorted it out on my own!

If you set your form field to be required, then you will need to remove the novalidate attribute from the checkout form. Find novalidate, which is inside the opening tag. The code might look something like this:

Delete novalidate:

1 Like

Thank you for posting the solution! I just had the same problem and this solved it for me as well.

Hi, I tried the solution and it only worked when I also applied the code to the ajax-cart-template.liquid. Is this something that you also had to do? Just wondering…

Any feedback would be appreciated. Thank you

Hello, That worked great! Thank you. Do you know how can we change the text which appears : “Please fill in this field” as it is not from the Edit default theme content..

You can change the text of the note field within the default theme settings. From the main Shopify page, click “Online Store”, then the “…” button next to the “Customize” button for your theme. Then "Edit Default Theme Content. Then click on “Sections” and scroll down till you find the label for “Note” in the Cart section and edit the text.