Writing a custom validator to validate multiple fields.