Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

234
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda