ngx-mask
ngx-mask copied to clipboard
HELP: Using Prefix/Suffix - What is the mask value to accept all characters of any length?
Description
Thanks for this great plugin. We purely want to use this feature to add prefix and suffix to the input text. The only thing we can't workout what is the mask value that can accept any character (ie Integers, decimals, upper and lower case letters) of any length?
Thanks in advance.
Hi I was also working on same issue… I wanted the text input to start with “I Will” but limit it to 80 characters.
I achieved it by,
<input
mask="N{80}"
[specialCharacters]="[' ']"
[dropSpecialCharacters]="false"
[pattern]="myPattern"
/>
And in compontent.ts
myPattern = { N: { pattern: new RegExp('[ -~]'), optional: true } }
needless to say, but increase N{80} to bigger number like N{10000} and your problem will be solved
@bkarv Thanks for using Ngx-mask. It example for ur case - https://stackblitz.com/edit/angular-9qkmhg?file=src%2Fmain.ts If you need to add more specialCharacters u can add it to pattern