All Projects → carolineschnapp → cart-attributes-validation

carolineschnapp / cart-attributes-validation

Licence: other
Drop-in jQuery file that validates your cart attributes on the /cart page

Programming Languages

Liquid
124 projects

Use the HTML5 'required' attribute or use the class 'required' on your form field. It makes no difference which of the 2 you use. Go with what you prefer. Example:

<input type="text" class="required" name="attributes[some-info]" value="{{ cart.attributes.some-info }}">

... or:

<input type="text" name="attributes[some-info]" value="{{ cart.attributes.some-info }}" required>

Then, add the content of validate-cart-attributes.liquid to your theme's layout/theme.liquid file. Paste the content before the closing tag, that's near the bottom of theme.liquid.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].