Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

113
Vistas
Prevent letters from input is not working how I want

I have the following code: https://codepen.io/ion-ciorba/pen/MWVWpmR

The problem is on "Suma solicitata" value, there you can click and edit the value, but when trying to replace a number inside the whole one, the newly replaced number will go to the end of it. How can I fix this, I think it's because of that:

var preventOnlyLetters = function (event) {
                    $(this).val($(this).val().replace(/[^\d]+/, ""));
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

It's happening because you are triggering this function both on keypress and keyup. You should only have it on either keyup or keypress. But I think it would be much better if you just make the input type="number"

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda