343
Views
2
Comments
[Input Masks Library] How to Create Custom Masking
Question
input-masks-mobile
Reactive icon
Forge asset by Labs

Hi, I want to create a custom masking,

Where I need to add a  '-' i.e dash after every 4 characters.

And the Input will be of max 12 alphanumeric characters.

2024-12-19 12-19-39
Amal
 
MVP

Hi Assif, 

The groupseparator can be used for the "-". 

Apart from that I modified the creditcard mask script 

Steps 1) Find and replace 16 with 12 (the number of digits you want). 

           Updated the MaxLength Attribute of MaskedInput to 

12 + (Length(GroupSeparator) * 2)


Step 2) Change the regex from digits to alphanumeric in InputMasks.js for the creditcard mask.


Hope it helps. The regex part is not complete.But I am sure you can figure it out.


Regards

Amal 

2021-04-09 11-42-43
assif_tiger
 
MVP

Thanks Amal Raj,

Appreciate your Kind Assist.

for the time being, I have created a custom Input to achieve the same behavior.

I'll try this with your approach & comeback :)


Cheers,

Assif


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.