Input mask with croatian chars

Hi!

How can I set the masked input to allow only numbers and uppercase letters?
I try with 

<ejs-maskedtextbox ejs-for="AuthPlates.regoznaka" id="regoznaka" mask=">AAAAAAAAAAAAAAA" locale="hr"></ejs-maskedtextbox>
but then I cannot enter, for example, croatian chars...like ŠĐČĆŽ.


Thanks!

Bernard.


3 Replies

PM Ponmani Murugaiyan Syncfusion Team July 5, 2021 02:11 PM UTC

Hi Bernard, 

Thanks for contacting Syncfusion support. 

You can achieve your requirement using the customCharacters property. Please find the sample below for reference. 


<ejs-maskedtextbox id="mask1" mask="PPPPPPPPPPPPP" customCharacters="ViewBag.cusObj" floatLabelType="Never"></ejs-maskedtextbox> 

namespace Syncfusion_EJ2_Core_App.Controllers 
{ 
    public class HomeController : Controller 
    {  
        public IActionResult Index() 
        { 
            CustomCharacters customObj = new CustomCharacters(); 
            customObj.P = "ŠĐČĆŽ"; 
            ViewBag.cusObj = customObj; 
            return View(); 
        } 
    } 
} 
public class CustomCharacters 
{ 
    public string P { get; set; } 
} 


Please get back us if you need further assistance. 

Regards, 
Ponmani M 



BJ Bernard Jurlina July 5, 2021 07:50 PM UTC

Hi Ponmani!

Thanks! It's working great. Just what I needed.
Just, maybe some solution for non-fixed length of the mask? If the mask is >AAAAAAAAAAAAAAA that means 15 chars is possible to input and there is _ sign in the textbox. Is there some property to turn it off?


Thanks!

Bernard.



PM Ponmani Murugaiyan Syncfusion Team July 6, 2021 11:05 AM UTC

Hi Bernard, 

Thanks for the update. 

Query: If the mask is >AAAAAAAAAAAAAAA that means 15 chars is possible to input and there is _ sign in the textbox. Is there some property to turn it off? 

If you enable the mask property automatically the _ sign will be included in the input, which allows standard mask elements , custom characters and regular expression as mask elements. If the mask value is empty, the MaskedTextBox will behave as an input element with text type.  

So, if you would like to turn off the _ sign in masked textbox, then you can remove the mask property, but it will act as default input with type text. 

Regards, 
Ponmani M 


Loader.
Up arrow icon