How to make a field required with conditional logic?