Skip to content

olythy/jquery-format-phone-number

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Simple Phone Number Formatter Plugin for jQuery

Install

Include script after the jQuery library.

<script src="/path/to/jquery.formatphonenumber.js"></script>

The plugin can also be loaded as AMD or CommonJS module. Read more http://requirejs.org/docs/whyamd.html

Usage

Default format is "###-###-####"

$(".phoneNumberInput").formatPhoneNumber();
// or
$(".phoneNumberInput").formatPhoneNumber({format: '+(##) ## ###-####'});

Valid charactes for format pattern: [# (hash mark, it mean a number), space, rounded brackets, +, -]

For example, if format is "+(##) ## ###-####" and the input text is 36771232345 then the updated value of the input will be +36 77 123-2345

About

Simple Phone Number Formater Plugin for jQuery

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published