Validating fields based on multiple other fields