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

122
Views
Limit HTML date input to today's date

I have an input type date on my form that I limited to only use today's date by setting the min and max attribute to today with the help of javascript. The problem is the user can still type a different date instead of picking it using the little calendar popup. Is there a way to not allow this?

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

0

According to specification min and max shall only affect form submission if violated. GUI behavior is not standardized and therefore does depend on the browser vendor and its specific version. For example, on Chrome 97 I'm not allowed to type the year 2019 in this demo page. As you can see the year text is gray and I'm not allowed to alter it:

enter image description here

You should use a non-native element, to achieve consistent behavior. See for example JQuery DatePicker

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!