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

103
Vistas
Why getting info form fields is not working

I'm trying to validate a form field for a college exercise, but I'm not succeeding. I do not understand clearly where is the error. Can someone tell me where is the error and why? I do not need the code to copy and paste. I need to understand what is wrong. The function checkUsername(valor) appears as it in the test document.

I appreciate any help.

<input type="text" 
  class="input" id="username" name="username" 
  placeholder="nombre de usuario" required />
function checkUsername(valor){
  valor = document.getElementById('username').value;
  if (/^[a-zA-Z0-9\_\-]{4,30}$/g.test(valor)){
    return true;
  } else {
    return false;
  }
}
about 4 years ago · Juan Pablo Isaza
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