Applying a phone number format mask in oracle apex

女生的网名这么多〃 提交于 2019-12-02 20:15:19

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/51770342/applying-a-phone-number-format-mask-in-oracle-apex

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!