[Custom Input Masks] [Custom Input Masks] Input auto filling with "-" and mask broken after ajax refresh
Question
Forge component by Sara Gonçalves

Hi everyone,

Need your help with the Custom Masks. 

My requirement is the following for a input field

- The first letter should be capitalized (that's why I'm using the Ajax Refresh) 

Only is allowed:

- Letters

- Spaces

- "-"

- '

Example: 

The issue that I'm encountering is that when I input the char "-" the filed is auto filled with that character and after the ajax refresh those characters are wiped. 

After the Ajax Refresh the mask broke and now every other character is allowed, for example numbers.

Attach you can find the .oml with my solution.


Any help will be appreciated. In advance thanks!

Eugenio Daniel

maskTest.oml

mvp_badge
MVP
Solution

Hi Eugenio,

You need to remove this 

SyntaxEditor Code Snippet

removeMaskOnSubmit:true, autoUnmask:true

Looks like this is removing the symbols. I need to check why.

Instead of using the ajax refresh you can also use this 

SyntaxEditor Code Snippet

"{placeholder:"" "", regex: ""[A-Z]{1}[a-zA-Z]|-| |\'{0,49}""}"

Regards,

Marcelo


mvp_badge
MVP

Hi Eugenio,

When you ajax refresh you need to also include the MaskTest. Create a container with both the textbox and the mask inside and refresh the container.

Regards,

Marcelo

Hi Marcelo,


Thanks for the tip. That fixed the broken mask. But still i'm experiencing the auto fill of the "-" and the special characters get wipped after the refresh.


Thanks! 

maskTest2.oml

mvp_badge
MVP
Solution

Hi Eugenio,

You need to remove this 

SyntaxEditor Code Snippet

removeMaskOnSubmit:true, autoUnmask:true

Looks like this is removing the symbols. I need to check why.

Instead of using the ajax refresh you can also use this 

SyntaxEditor Code Snippet

"{placeholder:"" "", regex: ""[A-Z]{1}[a-zA-Z]|-| |\'{0,49}""}"

Regards,

Marcelo


Thanks that worked

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