Closed mblackritter closed 7 years ago
I updated it to also successfully validate the form mask entries and setup a JS Bin.
Thanks to Ember Validations' Format Validation we can easily validate the form masked inputs via regex like this:
mobile: {
presence: true,
format: {
with: /^([\+\(\)a-zA-Z ]|\d){17}$/, allowBlank: true, message: 'must be complete number'
},
Will this feature gets merged?
+1 would love to see this get merged :)
Just in case some other Ember starters scratch their head about Ember Forms and form masks like jQuery Inputmask or Masked Input.
The problem is (Or was) that {{em-input}} doesn't add the name property, and normally the form masks are also attached via ID, which seems not possible with Ember's IDs like "ember777", so we attach them via our now added name property.
Btw., if someone should have any input on the ID issue, I would like to hear about it.
ember_forms.js (Line 42):
In your app.js (In case of jQuery Inputmask):
I personally appreciate form masks, so I hope it helps someone. ;)