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

136
Views
Cómo aceptar solo el número en el campo de entrada usando js

Cómo hacer que el cuadro de entrada acepte solo números en el campo de entrada usando js event listener.

 <form action="#"> <label for="value">Value:</label> <input type="text" name="value" id="value" /> <button type="submit">Convert</button> <button type="reset">Clear</button> </form> <script> form.addEventListener(`submit`, function(event){ event.preventDefault(); }); </script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puede analizar la entrada a un número y luego verificar si es un número o algo más como NaN.

 if(typeof parseInt(input) ==="number"){ console.log("number!"); }

Tenga en cuenta que cualquiera puede omitir esto usando las herramientas de desarrollo, así que no olvide implementar la validación del lado del servidor. (Gracias por el consejo @samathingamajig)

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!