Display error message and stop execution

Tanks, but it doesn’t help.
I’m checking some content in a collection in the "on ready function of a form, and in some cases, I would like to send an error message to the user before the user start filling the form.
In general, I would like also to know how to send a specific error message if a user input is not correct.
I’m aware about the submit error & success messages, but that’s not what I’m looking for.