Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

128
Visualizações
Additional method JQuery validation with German special characters

I would like to use JQuery Validation to validate a text input field for text input. But with spaces and the german special characters (äöüß).

For this I have created an additional method "letterspecial":

    jQuery.validator.addMethod("letterspecial", function(value, element) {
    return this.optional(element) || /^[a-zA-Z\u0196\u0228\u0214\u0246\u0220\u0252\u0223]+$/.test(value);
}, "Letters only please with Special Charts and Spaces allow");

I'm pretty sure it's the RegEx, however I don't know how to set it correctly.

But maybe there is another solution?

Thanks a lot

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can simply use äöüß in your regex, no need for escaped unicode characters, as far as I can tell :

const regex = /^[a-zA-Zäöüß]+$/;

console.log(regex.test("üßeörgä"))
console.log(regex.test("héhé this is invalid hôhô"))

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda