ok, then I'll look for an element with a class of something like 'error-message' and if there isn't one I'll stick a span in, in the style of my code posted above.
Use an email address type! :-D
Trust me, I wouldn't even attempt to attempt that! Nothing that advanced.
What I had in mind really was for simple things like reference numbers, there are so many I couldn't possibly code all of them individually, but a simple way of creating a customised field (using Foti's slight change), examples:car reg no UK.......X123 WYZ or AB08 CDE......@*## @@@
You see what I mean?
An escape character might be handy, I guess some ref numbers could have a # or something in them.