Adding REQUIRED fields or checkboxes - Dawn Theme 7.0.0

Hello friends,

I am really hoping someone out there has a solution to this problem by now. I have read countless older posts that seemed to dead-end without resolution.

I would like to add some REQUIRED fields and buttons to my store. I have added some customization fields to my product pages, as well as a radio-button on the cart page. Using Shopify’s UI Elements Generator, I am easily able to create and insert these fields into the desired pages.

HOWEVER. Even when the generated code is set to be “required,” and indeed contains the lines

input required class="required"

within the code, the functional fields/buttons on the page are NOT in fact required. End-users can still add products and continue to checkout without filling or selecting the buttons.

For example, the entire code supplied to me by the Shopify UI Elements Generator > Cart Attributes is as follows:

<p class="cart-attribute__field">
  <label>Love your mother?  Save some plastic ?</label><br>
  <input required class="required" type="radio" name="attributes[Love your mother?  Save some plastic ?]" value="Retail packaging not needed"{% if cart.attributes["Love your mother?  Save some plastic ?"] == "Retail packaging not needed" %} checked{% endif %}> <span>Retail packaging not needed</span><br>
  <input required class="required" type="radio" name="attributes[Love your mother?  Save some plastic ?]" value="Retail packaging preferred"{% if cart.attributes["Love your mother?  Save some plastic ?"] == "Retail packaging preferred" %} checked{% endif %}> <span>Retail packaging preferred</span><br>
</p>

When this code is added to the main-cart-footer.liquid, it does indeed display the desired radio button choices, but the selection is not required to click through to the Checkout page.

Really hoping someone out there has finally solved this problem. I am using Dawn 7.0.0 but can upgrade to 9.0.0 if it would help. Cheers

2 Likes

Hi, I have the same issue, have you found a solution?

I’m having the same issue :cry: Has anybody solved it?

Wait, I found a solution :sweat_smile:
https://community.shopify.com/c/shopify-design/dawn-theme-add-required-custom-text-field-on-product-page/m-p/2091259

I hope that helps you guys too.

Hey RGIE!

Thanks for linking this. However, I’m still having a hard time getting this method to work for cart attributes. I am wanting to put a radio button on my cart page that the customer is required to select before continuing to the checkout. The method you linked seems only to work for me when I use it on a product attribute.

Any thoughts?