Coder Social home page Coder Social logo

rajaramtt / jquery-input-mask-phone-number Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 17.0 20 KB

jquery-input-mask-phone-number.js - A simple, easy jquery format phone number mask library

HTML 100.00%
jquery jquery-plugin masking jquery-input-mask phone-format javascript-library javascript phone-number phone jquery-library

jquery-input-mask-phone-number's Issues

Keying back and deleting at "-" breaks mask

Trying this library out for robustness. After entering in a number, if someone hits their arrow key back to a "-" and hits delete this library deletes the "-".

Instead hitting delete should gracefully shift the numbers back without affecting the dashes (minus removing them if there are not enough numbers.

Screen Shot 2019-11-26 at 2 31 55 PM

Newest build has logic error

The current program has an issue where validation checks are being done after input. So i can type characters as well as numbers and go over the normal phone number limit.

However, using this version 1.0.11 posted at npmjs.com works flawlessly.

I can see comparing the 2 files that the difference is on line 33 and 48

33$(this).on('keyup', function (e) { most recent on github
33$(this).on('keydown touchend', function (e) { version 1.0.11 posted at npmjs.com
48$(this).on('keyup', function (e) { most recent on github
48$(this).on('keydown touchend', function (e) { version 1.0.11 posted at npmjs.com

The only downside i noticed when using 1.0.11 on npmjs is that ctrl + v to paste numbers won't work however, right click and paste still does.

Ideally you might wan't to handle both issues somehow.

Entering number with 1 (country code) loses final number

Many people enter their phone number including the initial 1 (ex: 1-212-123-4567)
If someone does that it will only take the first 10 digits and drop the last digit.
Is there any way to set it to remove the initial 1 if they start the number with 1?

Tab out from input not working

After initiating this call, the tab out functionality is no longer working
$('#txtPhone').usPhoneFormat({
format: '(xxx) xxx-xxxx'
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.