OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Angular 6 ngx-mask plugin, multiple masks on same input field

  • Thread starter Thread starter Patrick Florian
  • Start date Start date
P

Patrick Florian

Guest
So i use this plugin https://github.com/JsDaddy/ngx-mask to mask an input field dynamically (while user is typing). So for example if my mask only accepts 123 and they type abc nothing will happen. The problem I am having is I need two masks on the same input field so I need for example 123 and abc to both be accepted not just one or the other. Here is my code sample following the docs at the link above.

Code:
<input id="main-office-phone"type="phone" minlength="10" prefix="+1 " mask="(000)-000-0000">

<p>So i use this plugin <a href="https://github.com/JsDaddy/ngx-mask" rel="nofollow noreferrer">https://github.com/JsDaddy/ngx-mask</a> to mask an input field dynamically (while user is typing). So for example if my mask only accepts 123 and they type abc nothing will happen. The problem I am having is I need two masks on the same input field so I need for example 123 and abc to both be accepted not just one or the other. Here is my code sample following the docs at the link above. </p>

<pre><code><input id="main-office-phone"type="phone" minlength="10" prefix="+1 " mask="(000)-000-0000">
</code></pre>
 
Top