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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...