How can I make a product field required? I have a drop-down of variants of a product. For example t-shirts:

{% for purchasable in product.variants %}
    &lt;option value=""&gt;Select&lt;/option&gt;
    &lt;option {% if purchasable.stock &lt;= 0 and purchasable.unlimitedStock == false %}disabled {% endif %} value="{{ purchasable.purchasableId }}"&gt;
        {{ purchasable.title }} &amp;ndash; {{ purchasable.price|currency(cart.currency) }}
    &lt;/option&gt;
{% endfor %}


As you can see I have "Select" as the default option, and it has no value. I can validate the form client side no problem, but I am curious if there is a way to designate that fields as required from the server-side? I can mark the field as required in the layout builder, but that is for the CP only I think.

If I do not choose an option, I get this error:

Craft\Exception 
Not a purchasable ID


Which makes perfect sense since I am not passing it a valid purchasable element.
I can mark the field as required in the layout builder, but that is for the CP only I think.


Nope... marking the field as required makes it required globally (regardless of if it's coming from the control panel or the front-end).