Probably a “big list” feature request:
Following the thread discussing a feature for “Maximum length of TextLine or TextArea” Maximum length of TextLine or TextArea
…it makes me think that it would be great if the built-in Input Types had support for writing a script (JavaScript?) that fired on each onchange() event of the input field, having the value as input, and returning an object with boolean errorState and string errorMsg
With such a feature, one could then write a script that either did a simple regexp match, or something more complex if you wanted to. You could for instance create different types of descriptive and helpful error messages that depended on the type of regex match you got, giving big bonus points to user-friendliness.
I’m not sure if there is an overlap between the help text and custom error messages, but this correlation should probably be assessed.
Returning a function that could do stuff in the form would be nice, but is probably a case better suited for writing completely new custom input types.
Of course one could implement custom validation and error messages if one extends Enonic XP with custom input types, but this feature request deals with the built-in input types, which would app developers to make them more user-friendly if they had this feature.