Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ahmetaksungur/akstelephoneinput
International Telephone Numbers
https://github.com/ahmetaksungur/akstelephoneinput
input international international-telephone international-telephone-numbers tel telephone telephone-number
Last synced: about 6 hours ago
JSON representation
International Telephone Numbers
- Host: GitHub
- URL: https://github.com/ahmetaksungur/akstelephoneinput
- Owner: Ahmetaksungur
- License: mit
- Created: 2021-05-23T14:46:58.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-06-12T07:11:21.000Z (over 3 years ago)
- Last Synced: 2024-11-02T10:34:06.919Z (6 days ago)
- Topics: input, international, international-telephone, international-telephone-numbers, tel, telephone, telephone-number
- Language: JavaScript
- Homepage: https://codepen.io/collection/pggzPE
- Size: 1.65 MB
- Stars: 6
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# aksTelephoneInput.js
International Telephone Numbers**[View the Demo on CodePen →](https://codepen.io/collection/pggzPE)**
![aksTelephoneInput](https://github.com/Ahmetaksungur/akstelephoneinput/blob/main/8d60f5dfb57b44b19390f654bd07c85513_57_19.gif?raw=true)
## Getting Started
Compiled and production-ready code can be found in the `dist` directory.
### 1. Include aksTelephoneInput.min.js on your site.
**Direct Download**
You can [download the files directly from GitHub](https://github.com/Ahmetaksungur/akstelephoneinput/archive/main.zip).
```html
```
```html
```
**CDN**
```html
```
```html
```
---```html
```
```html
```
**jQuery**
```html
```
---**NPM**
```bash
npm i akstelephoneinput
```## Document aksTelephoneInput.js
```html
```
```js
$("#tel").aksTelephoneInput({
valueNumberCode: false,
flagsUrl: "https://unpkg.com/[email protected]/flags/"
});
```
[Sample](https://codepen.io/ahmetaksungur/pen/abJwOzz).### Auto Country
```js
$("#tel").aksTelephoneInput({
valueNumberCode: false,
autoCountry: true,
geoCountries: function (callback) {
$.get("https://ipwhois.app/json/", function (data) {
callback(data.country_code);
});
},
flagsUrl: "https://unpkg.com/[email protected]/flags/"
});
```
[Sample](https://codepen.io/ahmetaksungur/pen/ExWXjPa).### Change Country
```js
$("#tel").aksTelephoneInput({
valueNumberCode: false,
changeCountry: function () {
console.log(this);
},
flagsUrl: "https://unpkg.com/[email protected]/flags/"
});
```
[Sample](https://codepen.io/ahmetaksungur/pen/WNpOvwg).### Attributes
```js
allCountries: [],
onlyCountries: [],
primaryCountries: [],
currentCountries: "",
autoCountry: false,
geoCountries: function (callback) {
$.get("https://ipwhois.app/json/", function (data) {
callback(data.country_code);
});
},
changeCountry: function () {},
placeholderNumber: true,
valueNumberCode: false,
searchBar: true
```## License
The code is available under the [MIT License](https://github.com/Ahmetaksungur/akstelephoneinput/blob/main/LICENSE).