115
Views
6
Comments
Solved
[Input Mask React] How to enable space " " in Input Mask React for alphabetic characters
inputmask-react
Reactive icon
Forge asset by João Barata
Service Studio Version
11.54.20 (Build 62656)

I'm making an app where the user will type his name in the input. I used the Input mask react forge to limit the characters typed by the user to just letters. However, it is not possible to use the space " " in the input so that the user can type his name correctly. How do I enable space in input?


Mask 1.png
2023-10-26 15-12-53
Mohammed Rizwan
Solution

Hi, @Vinicius Perpetuo 

You can handle it simply using condition in pattern by applying If(Selected="Name","^[A-Za-z ]+$","^[0-9]+$")

You can refer attachment 

Thanks

Mohd Rizwan

InputMask.oml
2025-04-17 05-42-16
Ajit Kurane
2023-08-29 14-56-14
vn_perpetuo

Hi Ajit Kurane

The property options in this link's example are not the same as mine. I put a photo attached with the options that appear in my properties.

2023-10-26 15-12-53
Mohammed Rizwan

Hello @Vinicius Perpetuo 

You can use input masking and applied pattern "^[A-Za-z]+$" to accept text with space 

I have attched the oml for your refrence.

Demo: https://personal-abfdzfhg.outsystemscloud.com/SampleD/Inputmask?_ts=638276384987757014

Thanks Regards

Mohd Rizwan

InputMask.oml
2023-08-29 14-56-14
vn_perpetuo

It works, thanks!   But I have another problem

On the site I'm making, there are 2 radiobuttons. What I want to do is: If the user clicks on the radiobutton "Name" he can only type letters. If the user clicks on the radiobutton "CPF" he can only type numbers.

For this I created an IF that is receiving the input, in the IF I put: Type query = CPF 

So for when it is true, I put a mask of only numbers. And for when it's False, I put the letters only mask.

The tip you sent me worked perfectly. But only with a mask, from the moment I put another mask to filter only by numbers, nothing works. Maybe it's because both masks have the same input as a reference? Can you tell me what it could be?

Mask 2.png
2023-10-26 15-12-53
Mohammed Rizwan
Solution

Hi, @Vinicius Perpetuo 

You can handle it simply using condition in pattern by applying If(Selected="Name","^[A-Za-z ]+$","^[0-9]+$")

You can refer attachment 

Thanks

Mohd Rizwan

InputMask.oml
2023-08-29 14-56-14
vn_perpetuo

Hi Mohammed Rizwan

It works, thank you so much!

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