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 6867761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:21:00+00:00 2026-05-27T03:21:00+00:00

Since I couldn’t get any solution for my question related to jQuery datapicker, I

  • 0

Since I couldn’t get any solution for my question related to jQuery datapicker, I thought I might need to write a code to verify the date myself. I have a textbox with date in format mm.dd.yyyy. How can I validate date in textbox should not be greater than the current date on blur?

Reminder.config = {
    BaseURL: "Reminder.ashx?" + Reminder.BaseURLQuery,
    tblHistory: "#tblHistory",
    txtNotes: "#txtNotes",
    txtDate: "#txtDate",
    btnSave: "#btnSave",
    dateFormat: 'mm.dd.yy',
};

Reminder.Init = function () {
//Set up calendar 
var $txtDate = $(Reminder.config.txtDate);
$txtDate.datepicker({
    dateFormat: Reminder.config.dateFormat,
    onClose: function (dateText, inst) {
        try {
            $.datepicker.parseDate(Reminder.config.dateFormat, dateText);
        } catch (e) {
            $txtDate.val('');
        };
    },
    maxDate: '+0'
});

$txtDate.datepicker('setDate', new Date()).blur(function () {
        try {
            if ($txtDate.val() == '') {
                $txtDate.datepicker('setDate', new Date());
            }            
        }
        catch (ex) {
            var myEx = myWeb.Exception(ex);
            myEx.AddData("Method", "$txtDate.datepicker('setDate', new Date()).blur");
        }
    });

};
  • 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-05-27T03:21:00+00:00Added an answer on May 27, 2026 at 3:21 am

    First of all, you’re already constraining your date picker to not select dates in the future.
    But you don’t say what seems to be the problem with that… Anyway…

    A blur even handler like this one should work as expected:

    $txtDate.blur(function(e){
        // this is now
        var now = new Date();
    
        // let date picker parse the date since it has formatting set
        var date = $txtDate.datepicker("getDate");
    
        // is date ok then?
        if ((date || new Date()) >= now)
        {
            alert("Does not compute");
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Thought this would be a good SO question since couldn't find anything on Google
since I couldn't find an answer to this question I researched a bit further
I never thought I'd have a need for anything this (since macros are bad,
I've been using throw new Exception(...) in my code, since I couldn't find anything
I want to create an Action to automate GCJ compilation. Since I couldn't make
I was trying to create an extension that could slice any array-like class (since
hi im doing a loop so i could get dict of data, but since
I am migrating my PHP code to Google App Engine - Java. Since I
I know I can answer this question easily for myself by generatin the code
I'm afraid that this one is a little tricky since I couldn't recreate the

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.