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

403
Views
Bootstrap Date Picker Validation

Hey guys I am working on a project that requires validation of the date picker to check whether the end date is greater than or equal to the start date! Can anyone help me with how to write jquery for it so that I can disable the dates based on the user's date selection restricting him/her to choose the dates within the starting and ending range entered by the user? The code looks like this:

<div class="mb-4">
    <label for="startdate" class="form-label">StartDate</label>
    <input type="date" class="form-control" id="startdate" name="startdate" />
</div>
 
<div class="mb-4">
    <label for="enddate" class="form-label">End Date</label>
    <input type="date" class="form-control" id="enddate" name="enddate" />
</div>

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

I'm not sure how to disable inside picker dates that are higher than the startDate, but like this you can do a validation

var startDate = new Date($('#startdate').val());
var endDate = new Date($('#enddate').val());

if (startDate < endDate){
// Do something
}
about 4 years ago · Santiago Gelvez 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!