在Oracle Apex中应用电话号码格式掩码 [英] Applying a phone number format mask in oracle apex

查看:178
本文介绍了在Oracle Apex中应用电话号码格式掩码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在数据库中有电话号码字段. 我想将我的电话号码格式更改为"XXX-XXX-XXXX",因为我没有在提交结果后键入

解决方案

请记住,最后,您的APEX页面几乎是一个HTML文档.也就是说,您可以使用所需的任何JavaScript或CSS对其进行调整.

对于输入掩码,我的转到"选项是: https://github.com/RobinHerbots/输入掩码

我尝试了很多JS库来掩盖输入,那是最适合我的项目的.

如果不确定如何使用它,请执行以下操作:

  1. 导入主 dist文件到您的应用.使用可以将其上传到工作区,应用程序,只要您能够在页面中引用它就没关系.

  2. 在您的Pn_PHONE页面项中,转到自定义属性并输入掩码,例如data-inputmask="'mask': '999-999-9999'"

  3. 页面加载时执行中输入以下代码:$(':input').inputmask();将掩码应用于具有data-inputmask的所有输入.

  4. 您已完成.

看看JS库用法来检查您可以使用的所有设置. /p>

I have phone number field in database. I want to change my phone number format to "XXX-XXX-XXXX" as I type not after the result is submitted

解决方案

just keep in mind that, in the end, your APEX page is pretty much an HTML document. That said, you're able to tweak it using any JavaScript or CSS you want to.

For input masks, my "go-to" option is: https://github.com/RobinHerbots/Inputmask

I've tried a lot of JS library to mask inputs and that one was the best for my projects.

If you're unsure how to use it, here you go:

  1. Import the main dist file to your app. Use can upload it to the workspace, app, it doesn't matter as long you're able to reference it in your page.

  2. In your Pn_PHONE page item, go to Custom Attributes and enter your mask, for i.e., data-inputmask="'mask': '999-999-9999'"

  3. In Execute when Page Loads enter this code: $(':input').inputmask(); to apply mask to all inputs with data-inputmask.

  4. You're done.

Have a look at the JS library usage to check all settings you can use.

这篇关于在Oracle Apex中应用电话号码格式掩码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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