简体   繁体   English

Cleave.js,获取特定国家的国家代码电话号码

[英]Cleave.js, getting the country code telephone digit for a particular country

For Anybody familiar with cleave.js out there.对于任何熟悉 cleave.js 的人。 am I able to get the country code digit?我能得到国家代码数字吗? in this case here for Italy, am I able to access the 39 for Italy?在这种情况下,意大利的情况下,我可以访问意大利的 39 吗? I am working on a form that will auto complete and show the country code (digits) and could not find a way to grab the digits.我正在制作一个自动填写并显示国家代码(数字)的表格,但找不到获取数字的方法。

new Cleave('.my-input', {
    phone: true,
    phoneRegionCode: 'IT'
});

Yes looks right, what error did you see while running.是的,看起来不错,您在运行时看到了什么错误。

let cleaverObj = new Cleave('.my-input', {
    phone: true,
    phoneRegionCode: 'IT'
});

or if you just want to get the information you collected, store the object of Cleaver in any variable like above.或者,如果您只想获取您收集的信息,请将 Cleaver 的 object 存储在上述任何变量中。 so that you can use it anywhere.这样您就可以在任何地方使用它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将默认值设置为<input/>元素,用 Cleave.js 格式化? - How to set a default value to an <input/> element, formatted with Cleave.js? 将第一个字符输入输入时,getPostDelimiter() 中的 Cleave.js 错误 - Cleave.js error in getPostDelimiter() when entering first character into input 为什么我不能在同一个js文件中建立两个cleave.js格式的字段? - Why can't I establish two cleave.js formatted fields in the same js file? React 中的 Cleave.js:TypeError:无法设置未定义的属性(设置“元素”) - Cleave.js in React: TypeError: Cannot set properties of undefined (setting 'element') 将 typescript 与 cleave.js 一起使用时,类型“EventTarget 和 HTMLInputElement”错误中不存在属性“rawValue” - Property 'rawValue' does not exist on type 'EventTarget & HTMLInputElement' error while using typescript with cleave.js 如何在react js中使用IP获取国家代码和国家名称 - How to get country code and Country name using IP in react js 在我的角度项目中使用@ types / cleave.js时,如何忽略TS1192? - How do I ignore TS1192 when using @types/cleave.js in my angular project? 带有国家/地区同步功能的国际电话输入插件不起作用 - International Telephone Input with Country sync for plugin not working 没有从 intlTelInput 输入中获取国家代码 - not getting Country code from intlTelInput input 在PHP中从国家/地区代码获取货币信息 - Getting Currency Information From Country Code in PHP
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM