formly-js / angular-formly

JavaScript powered forms for AngularJS
http://docs.angular-formly.com
MIT License
2.23k stars 406 forks source link

pattern/patternValidationMessage is not working properly #717

Closed CodeLiftSleep closed 7 years ago

CodeLiftSleep commented 7 years ago

I honestly don't need to post a JSBin of this its simple to test, and I tested it in your example JSBin that was linked to the ReadMe in this and the same issue occurred:

Go to any input field and add: {.... , pattern: /[A-z]/, patternValidationMessage: "Say whatever" }

No matter what is typed in the input, the pattern never matches, I have tried every way of putting in a regex, but nothing works---I've tried it in double quotes, single quotes, no brackets, etc.... The only way I've gotten pattern to work is by typing it in directly like "abc" and then if I type in abc in the input it matches and goes green. But the patternValidationMessage never shows either, no matter what.

CodeLiftSleep commented 7 years ago

Issue was with the way formly handles RegEx patterns...got it working, the normal Javascript method doesn't work...

davidwmemlink commented 6 years ago

how did you make it work?