This validation technique can only be used on inputs that are within a form.
Properties must have at least one validation requirement to show highlighting on a failed onSubmit()
validation. Data types (other than string) have a hidden data type requirement, so do not require an explicit data annotation. Strings do not have this, so to force a validation check along with the other fields, add the data annotation [MinLengthAttribute(0)]
.