We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to pas phone numbers with different formats: '+{7}(000)000-00-00' and '8(000)000-00-00' How to do it with this mask?
The text was updated successfully, but these errors were encountered:
Hi... Your question can be resolved by the code below (using the last version jQueryMask v1.11.1):
<div class="col-xs-6 col-sm-6 col-md-4"> <div class="form-group"> <label>Combined Values</label> <input type="text" name="combined" class="form-control"> </div> </div> // Mask Phones var combinedPhonesBehavior = function (val) { return val.charAt(0) == '+' ? '+{0}(000)000-00-00' : '+0(000)000-00-00'; }, combinedPhonesOptions = { onKeyPress: function(val, e, field, options) { field.mask(combinedPhonesBehavior.apply({}, arguments), options); }, translation: { '+': { pattern: /[+]/, optional: true} } }; $(function() { $(':input[name=combinedPhones]').mask(combinedPhonesBehavior, combinedPhonesOptions); });
See in action here: https://jsfiddle.net/pyetrosafe/ug18qj9m/5/
Sorry, something went wrong.
No branches or pull requests
I want to pas phone numbers with different formats: '+{7}(000)000-00-00' and '8(000)000-00-00'
How to do it with this mask?
The text was updated successfully, but these errors were encountered: