This dojo provides an example of custom validation. I set up my own rule for the ownerId input (it has to be Charlie, which has value 3 in that example), and my own message for if the validation fails.
You will want to utilize a custom editor template for this, which gives you greater control and flexibility.
Custom editor template example
you could potentially create a validator on the built in pop up editor, but grabbing the fields to check validation on will be much more difficult.
If you just want to check if the field is populated, just add a required attribute, a data-required-msg attribute, and then:
Then just call validate() with that and it easily determines if the field has a value, and if not, prevents the user from continuing.