A function that validates your form. Returns a list of form errors, or an empty list if there are no errors - in which case isValid will be true.
List<FormError> validator();