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

223
Vistas
How can I make my form only except values that the user entered that are between 1 - 100 (e.g like for the age box)

I want this to apply to the age input box and to only except the values that are between 1 - 100,in 'javascript'.

 <h1>Form</h1>

<form name="form"  onsubmit="myFunction()" method="post" action="">

<div>
    <input type="text" required minlength="3" maxlength="20" placeholder="Enter your first name">
</div>

<div>

    <input type="text" minlength="3" maxlength="20" required placeholder="Enter your last name">
</div>

<div>
    <input id="age" required name="number" type="number" placeholder="Enter your age">
</div>

<div>
    <input type="text" required placeholder="Enter your email">
</div>

<div>   
    <input type="submit" required value="Submit">
</div>

</form>
about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The attributes min and max is probably what you're looking for.

<input id="age" required name="number" type="number" placeholder="Enter your age" min="1" max="100">

You may need to clarify what you mean by "only except the values that are between 1 - 100,in 'javascript'." if not.

about 4 years ago · Santiago Trujillo 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