Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

102
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!