使用 intlTelInput 获取完整号码 [英] Get the full number using intlTelInput

查看:41
本文介绍了使用 intlTelInput 获取完整号码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 intlTelInput 提供的演示代码 这里

I am using the demo code for intlTelInput provided here

我可以使用以下方法获取拨号代码

I am able to get the dial code using following

var intlNumber = $("#phone").intlTelInput("getSelectedCountryData");

但我无法从#phone 文本框中获取完整号码,即用户输入的拨号代码 + 号码".

But i am not able to get the full number i.e. "dialcode + number entered by user" from the #phone text box.

推荐答案

使用 getnumber 选项,所以在您的情况下:

Use the getnumber option, so in your case:

var intlNumber = $("#phone").intlTelInput("getNumber");

^ 这会给你完整的号码(国家代码 + 电话号码)

^ This will give you the entire number (country code + phone number)

在此处查看文档.

这篇关于使用 intlTelInput 获取完整号码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆