You could do this in the xlsform as shown in the image below:
In the survey tab of your xlsform:
Data entry screen as seen in Enketo:
Reference xlsform:
Error Message.xlsx (10.3 KB)
You could do this in the xlsform as shown in the image below:
Error Message.xlsx (10.3 KB)