I used this approach: every input field has id
set to ModelFieldname
like UserUsername
. I used something like in the link you provided, to pass error messages with names of fields to js. And in js, I used ids of fields to insert error messages something like this:
$(form+name).before('some styled span with error message');
where form is for example #User
and name
is the name of field with error eg. username
(of course I had it set to upper case first).
There is probably better ways to do it, but that's what I use and it serves me well so far.