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

249
Views
how can I solve this problem ? : At least one numeric character allowed without regex
if(password.search(/[0-9]/)){
    document.getElementById('fpasswords').innerHTML="*atleast one numeric character";
    return false;
}

here i used regex but i don't want to use it so what's the solution?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can check each character with the function isNaN, this function returns false is it's a numeric character and true if it's not:

const str = 'Papayas1';

for (var i = 0; i < str.length; i++) {
  
  if(!isNaN(str.charAt(i))) console.log('this is a number')
  else console.log('this is not a number')
}
about 4 years ago · Juan Pablo Isaza Report
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!