Making note section mandatory (cart attributes) not working!

Solved
lbmedia1
Excursionist
10 2 3

Hey team!

I am adding this to the cart:

<p class="cart-attribute__field">
<label for="note-for-enclosure-card-if-not-applicable-type-na">Note for Enclosure Card (if not applicable type N/A)</label>
<textarea required class="required" id="note-for-enclosure-card-if-not-applicable-type-na" name="attributes[Note for Enclosure Card (if not applicable type N/A)]">{{ cart.attributes["Note for Enclosure Card (if not applicable type N/A)"] }}</textarea>
</p>

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?

Accepted Solution (1)

Accepted Solutions
lbmedia1
Excursionist
10 2 3

This is an accepted solution.

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 <form> tag. The code might look something like this:

<form action="/cart" method="post" novalidate class="cart">

Delete novalidate:

<form action="/cart" method="post" class="cart">

View solution in original post

Replies 2 (2)
lbmedia1
Excursionist
10 2 3

This is an accepted solution.

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 <form> tag. The code might look something like this:

<form action="/cart" method="post" novalidate class="cart">

Delete novalidate:

<form action="/cart" method="post" class="cart">

View solution in original post

GreenFlux_LLC
New Member
2 0 1

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