Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8182347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:50:12+00:00 2026-06-07T00:50:12+00:00

I have a datepicker and it can not allow dates prior to today VIA

  • 0

I have a datepicker and it can not allow dates prior to today VIA the editbox.

var dateOptions = { 
  dateFormat: "mm/dd/yy", 
  constrainInput: true, 
  gotoCurrent: true, 
  minDate: new Date()
};

$('.date').datepicker(dateOptions);
$('.date').datepicker('setDate', new Date());

In the html it’s implemented as:

<label class="text14"><strong>Depart</strong></label>
<input type="text" id="tbDTimeOne" maxlength="10" size="10" name="tbDTimeOne" class="colum130 date" /> <img src="images/calendar.png" style="margin-left:-25px;" />

OK, so here’s what happens. The page gets rendered, the onready function gets called, date input gets set to todays date, user tabs/clicks to the date input, the calendar pops up, the user edits the existing date via the keyboard and sets it to a date prior to today, the user tabs to the next field. The input accepted and shown is a date prior to the minDate.

What’s the solution to this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T00:50:13+00:00Added an answer on June 7, 2026 at 12:50 am

    The Datepicker does not restrict keyboard input (see http://bugs.jqueryui.com/ticket/6917)

    $('.date').attr('readonly', 'readonly');
    

    would be a solution, but then you’ll lose the possibility to enter text by Hand.
    If you need to keep this functionality, you can still validate the input
    http://keith-wood.name/uiDatepickerValidation.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to have my localized datepicker not allow certain dates picking. Localization: $(#datepicker).datepicker($.datepicker.regional[fr]);
I have a DatePicker and a TimePicker in my app. Can anyone tell me
Can I have good example or code about how to use Ajax Datepicker in
I can't get the jQuery datepicker to work. I have followed everything from the
I have a datepicker, and I pick up two dates, like 2012-04-08 and 2012-05-11.
I have datepicker, but I could not find a way to validate if the
I have a datepicker with maxdate set as today. Here is how I defined
I've seen examples where you can have jQuery UI Datepicker show two months, side-by-side,
I have following function in my asp.net MVC view: $(function() { $('#datepicker').datepicker({ changeMonth: true,
I have a datepicker control setup using the JQuery UI, I am also using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.