Form Validation: Required Value for Select Box with Default Option

I’m in the process of building a form in Grav, and I have a select box of Canadian provinces. I want to make sure that the user is specifying their province, so I have a default placeholder “default: Select Your Province”. How do I validate this field so that it is required but the placeholder value isn’t accepted as valid?

Here’s what I have at the moment:
—yaml

name: province
id: province
label: Province
type: select
options:
default: Select Your Province
AB: Alberta
BC: British Columbia
MB: Manitoba
NB: New Brunswick
NL: Newfoundland and Labrador
NT: Northwest Territories
NS: Nova Scotia
NU: Nunavut
ON: Ontario
PE: Prince Edward Island
QC: Quebec
SK: Saskatchewan
YT: Yukon
validate:
required: true

Instead of a default value, you can use placeholder instead!


name: province
id: province
placeholder: Select your Province
label: Province
type: select

I can’t believe I didn’t think of that, seeing as I was already using placeholders for my other fields. Thanks!

Also please update to latest Form plugin, there has been a couple of fixes that might affect this.