Is there a way to add custom inline error reporting per form field?

Let’s say I have a field that should only accept 8 numbers. I would like to create a form validation process that if false, it shows the error inline for that field.

Is there a way to accomplish this with PHP? or a custom JavaScript code is the only way?

form validation filter Form Element – Bricks Academy