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

222
Views
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 answers
Answer question

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 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!