Making Metafields required to add to cart/checkout

I’ve added a metafield to take customer input regarding the color of a product - but currently they can add to cart/checkout without filling out the field - is there a way to make it required?

I implemented the feature according to this Guide

Any help would be appreciated.

Solved it myself. Looks like a required=“required” in the options is all it took.

Hi
I have wrote required=“required” in registration form. but for me it doesn’t work. I am using Habitat theme. can you please help me