Perhaps this would be nicer:

```
if (!value) {
  if (field === 'displayName') {
    oae.api.util.notification('Invalid tenant name.', 'Please enter a tenant name.', 'error');
  } else if (field === 'host') {
    oae.api.util.notification('Invalid host name.', 'Please enter a host name.', 'error');
  }
} else if (field === 'host' && !checkValidHostname(value)) {
  oae.api.util.notification('Invalid host name.', 'Please enter a valid host name.', 'error');
} 
```