29
Views
7
Comments
Solved
[Input Mask React] How to masked the input mask react?
Question
inputmask-react
Reactive icon
Forge asset by João Barata
Service Studio Version
11.54.74 (Build 63545)

Hi, is it possible to create a masked to hide the input? 
For instance, 

Taken from site: mask.jr.org


I tried to play around the settings and couldnt seems to be able to get the desired function for the forget input mask react..


2024-06-24 15-21-58
Ahmed Hani
Solution

Check the behavior in this test screen and let me know if this is what you've wanted
SecurePatternIMaskDemo

I've used iMask Js forge component but I've customized it a little bit to add support for custom definitions

iMaskJs_PAT.oml
SecurePatternIMaskDemo.oml
UserImage.jpg
Chin Kai

Hi Ahmed thanks for the oml file, but I am having some issue running the file for reference....


Are there any alternatives on other forge component?


May I also know what customization you did? 

2024-06-24 15-21-58
Ahmed Hani
Solution

The current IMask Js forge component doesn't support custom definitions, which you need in order to create the same secure pattern in the example.

That's why I've modified the forge component by making it accept a 2 new input parameters (custom definitions, overwrite)


I've attached the modified iMaskJs_PAT.oml in the previous message.


If you don't want to use the oml I've attached I'd recommend modifying the forge component yourself or asking the owner of the component to add that feature.

UserImage.jpg
Chin Kai

I am currently viewing the iMaskJs_PAT.oml. May I know how do I implement it on my end?

2024-06-24 15-21-58
Ahmed Hani
Solution

By modifying the CustomMask block and adding 2 new input parameters (CustomDefinitions, Overwrite) and using them in the Mask_Initialize client action inside the javascript code.
You can pass them into the IMask object constructor like the attached screenshot and now the CustomText block will support the taking Definitions and overwrite input variables. 

And as You can see in the SecurePatternIMaskDemo.oml I'm using the CustomText block and sending 'shift' into the overwrite input parameter and sending the output of GetSecureCustomDefinitions function to Custom Definitions

Inside the GetSecureCustomDefinitions function you'll find me initializing the Definition object with the same parameters that are defined in the example on the IMask Js website

2024-06-24 15-21-58
Ahmed Hani

Hello Chin,

I believe that you have selected the wrong forge asset.

[Input Mask React] is based on github.com/RobinHerbots/Inputmask and not the site you've added a screen shot from https://imask.js.org

I would recommend depending on a forge component that's based on IMask js

UserImage.jpg
Chin Kai

Hi Ahmed... yeah I installed this forge as well but could not find the function.... 

so the screenshot is taken from https://imask.js.org...

I tried the demo and there is no function to do that masking of input field..

Are there any alternatives? 

2024-06-24 15-21-58
Ahmed Hani
Solution

Check the behavior in this test screen and let me know if this is what you've wanted
SecurePatternIMaskDemo

I've used iMask Js forge component but I've customized it a little bit to add support for custom definitions

iMaskJs_PAT.oml
SecurePatternIMaskDemo.oml
UserImage.jpg
Chin Kai

Hi Ahmed thanks for the oml file, but I am having some issue running the file for reference....


Are there any alternatives on other forge component?


May I also know what customization you did? 

2024-06-24 15-21-58
Ahmed Hani
Solution

The current IMask Js forge component doesn't support custom definitions, which you need in order to create the same secure pattern in the example.

That's why I've modified the forge component by making it accept a 2 new input parameters (custom definitions, overwrite)


I've attached the modified iMaskJs_PAT.oml in the previous message.


If you don't want to use the oml I've attached I'd recommend modifying the forge component yourself or asking the owner of the component to add that feature.

UserImage.jpg
Chin Kai

I am currently viewing the iMaskJs_PAT.oml. May I know how do I implement it on my end?

2024-06-24 15-21-58
Ahmed Hani
Solution

By modifying the CustomMask block and adding 2 new input parameters (CustomDefinitions, Overwrite) and using them in the Mask_Initialize client action inside the javascript code.
You can pass them into the IMask object constructor like the attached screenshot and now the CustomText block will support the taking Definitions and overwrite input variables. 

And as You can see in the SecurePatternIMaskDemo.oml I'm using the CustomText block and sending 'shift' into the overwrite input parameter and sending the output of GetSecureCustomDefinitions function to Custom Definitions

Inside the GetSecureCustomDefinitions function you'll find me initializing the Definition object with the same parameters that are defined in the example on the IMask Js website

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