[Custom Masks] [Custom Masks] Input auto filling with "-" and mask broken after ajax refresh

[Custom Masks] [Custom Masks] Input auto filling with "-" and mask broken after ajax refresh

  
Forge Component
(25)
Published on 14 Nov (4 weeks ago) by Caio Santana Magalhães
25 votes
Published on 14 Nov (4 weeks ago) by Caio Santana Magalhães

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

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! 

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


Solution

Thanks that worked