jaridmargolin / formatter.js

Format html inputs to match a specified pattern
http://firstopinion.github.io/formatter.js
2.48k stars 235 forks source link

Allow Caps Enforcement #24

Closed joshvickerson closed 10 years ago

joshvickerson commented 10 years ago

Would it be possible to implement forced capitalization in patterns? Specifying 'A' instead of 'a' for auto capitalization, for example?

jaridmargolin commented 10 years ago

There is now a method addInptType. It allows for creation of new input types for use in patterns.

Example:

Formatter.addInptType('L', /[A-Z]/);

new Formatter({
  pattern: '{{LL}}'
});