Jump to content

do you have to remove accentuated letter-typing from the client side?


eduardosuruagy

Recommended Posts

2 hours ago, Sherzod said:

Desculpe, você pode por favor esclarecer sua pergunta?

In my record screens I would like to restrict the accented letters in the Edits fields, type these letters á, é, í, ...
How can I do this on the client side? On the server side I get it, but I think it's faster on the client side.

Link to comment
Share on other sites

 

function keypress(sender, e, eOpts)
{

// [\u0300-\u036f]/g this code snippet is a regular expression
// that takes the range of accents: ', ~, ^

  function removerAcentos(s) {
   return s.normalize('NFD').replace(/[\u0300-\u036f]/g, "")
}      
  
  var val = sender.getValue() ; 
  sender.setValue(removerAcentos(val)); 
  
}

best regards

Eduardo Belo

Link to comment
Share on other sites

On 6/28/2019 at 2:05 AM, belo said:

 


function keypress(sender, e, eOpts)
{

// [\u0300-\u036f]/g this code snippet is a regular expression
// that takes the range of accents: ', ~, ^

  function removerAcentos(s) {
   return s.normalize('NFD').replace(/[\u0300-\u036f]/g, "")
}      
  
  var val = sender.getValue() ; 
  sender.setValue(removerAcentos(val)); 
  
}

best regards

Eduardo Belo

Muito obrigado Eduardo, funcionou!!!

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...