/
Improved "invalidformat" message
Improved "invalidformat" message
Right now, when value in a field doesn't match regular expression, specified in "regexp" field option then "Invalid Format" text is displayed and user really don't understand what is wrong with field value he entered.
I'm proposing "Invalid format" message to list symbols, that weren't allowed. New phrase translation would be "Following symbols are not allowed: %s".
To accomplish this we need to do the following:
- take regular expression, that usually looks like this:
/^[abcd]+$/
- remove "^" and "$" symbols from it to allow matching allowed symbols in any part of field value
- use resulting regular expression to replace all allowed symbols with empty string
- display left symbols in error message