Adding a REQUIRED Cart Attribute to Dawn Theme

Topic summary

A user is implementing a required cart attribute in the Dawn theme to let customers select which fundraiser they’re supporting. The attribute displays on the cart page but isn’t enforcing validation—customers can proceed to checkout without making a selection.

Initial Issue:

  • The form tag lacks the typical novalidate attribute that would need removal
  • The required attribute on the select field isn’t functioning as expected

Solution Provided:

  • Ensure proper HTML5 DOCTYPE is present
  • Add an empty first option value (required validation only triggers on empty values)
  • Use a shorter, simpler name for the cart attribute instead of the lengthy “Please select the fundraiser you are supporting with this purchase”
  • Note that labels don’t need to match the property name exactly

Remaining Challenge:

  • The attribute now works when customers visit the cart page, but customers can still bypass the cart entirely and go straight to checkout, avoiding the required field altogether
  • The user is seeking a method to force cart page visits before checkout
Summarized with AI on November 20. AI used: claude-sonnet-4-5-20250929.

I am trying to add a required Cart Attribute to my Dawn Theme. The cart attribute is added above the tag in main-cart-items.liquid, but it is not appearing as required, and customers are able to go to checkout without selecting an option. All help pages have said to delete “novalidate” in the form line, however my main-cart-items.liquid form line does not have this! Please help me make this required, thank you!!

form line:

cart attribute:

Please select the fundraiser you are supporting with this purchase

There is a ‘insert/edit code sample’ button to format code for readbility.

Mandatory: Have the first value empty - required works on empty values

Prerequisites: correct html5 DOCTYPE and a named input field

From https://stackoverflow.com/questions/6048710/can-i-apply-the-required-attribute-to-select-fields-in-html

Also the label for a cart attribute does not have to match the property name.

“Please select the fundraiser you are supporting with this purchase” is a bit excessive to have go through the checkout, makes it easy to make broken code through typos and complicate future automation,etc.

“Fundraiser” or “Preferred Fundraiser” or “Selected Fundraiser” are all suitable.


  

  

Thank you!! Do you know if there’s a way to make customers unable to go to checkout without visiting the cart page first? The cart attribute is now required if the customer is on the cart page, but customers can still go straight to checkout without ever landing on the cart page.