简体   繁体   中英

Is there a jquery widget for entering international phone numbers?

I need to accept international phone numbers on my HTML form.

Is there any open-source javascript / jquery widget for inputting international phone numbers? I'm looking for something similar to what Skype has:

Skype的小部件

Desired features:

  • Good usability. I realize this is vague; that's why I want to use something well tested, instead of writing my own.
  • User can type in a number directly (+373 22 717171).
  • User can select a country (Moldova), the widget automatically fills in the country code (+373), and lets the user type the rest of the number.
  • Developer can programatically get / set the country code.

(This is NOT a question about validating phone numbers. I already know how to do that using the javascript version of libphonenumber .)

This is what you want, with some areas are removed, which can be found in the source code. https://github.com/Bluefieldscom/intl-tel-input

I have created a simple widget in JS & HTML which accepts international phone numbers.

  • Easy to plug into your code
  • Works well on iphone, ipad and android phones
  • Very light weight
  • CSS sprites used in rendering the country flags – so there is no negetive impact on page load performance
  • You can change the UI as per your liking.
    Get the source code: International telephone widget - github
    Checkout the demo - Demo

    The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

     
    粤ICP备18138465号  © 2020-2024 STACKOOM.COM