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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:22:21+00:00 2026-06-08T07:22:21+00:00

I have successfully integrate jQuery DatePicker on my site and wondering how can I

  • 0

I have successfully integrate jQuery DatePicker on my site and wondering how can I set the following:

  1. Don’t allow selection of start date from current date plus 2 days. example if today’s date is 7/20/12 then the visitor can select only date starting 7/22/12.
  2. End date must start based on Start Date plus one. If start date is 7/23/12 then the end date should be 7/24/12.

BTW, I am making a hotel reservation calendar.

Here’s my code based from sample:

<script>
    $(function() {
        $( "#sd" ).datepicker();
    });

    $(function() {
        $( "#ed" ).datepicker();
    }); 
</script>

<tr>
  <td>Check In</td>
  <td>:</td>
  <td><input name="sd" type="text" id="sd" value="<?php echo $_SESSION['checkin'] ?>" size="10"" maxlength="8" /></td>
</tr>
<tr>
  <td>Check Out</td>
  <td>:</td>
  <td><input name="ed" type="text" id="ed" value="<?php echo $_SESSION['checkout'] ?>" size="10" maxlength="10" /></td>
</tr>
  • 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-08T07:22:23+00:00Added an answer on June 8, 2026 at 7:22 am

    You can do it inside your datepicker events.

    $(function() {
        $( "#sd" ).datepicker({
            // before datepicker opens run this function
            beforeShow: function(){
                // this gets today's date       
                var theDate = new Date();
                // sets "theDate" 2 days ahead of today
                theDate.setDate(theDate.getDate() + 2);
                // set min date as 2 days from today
                $(this).datepicker('option','minDate',theDate);         
            },
            // When datepicker for start date closes run this function
            onClose: function(){
                // this gets the selected start date        
                var theDate = new Date($(this).datepicker('getDate'));
                // this sets "theDate" 1 day forward of start date
                theDate.setDate(theDate.getDate() + 1);
                // set min date for the end date as one day after start date
                $('#ed').datepicker('option','minDate',theDate);
    
            }
        });
        $( "#ed" ).datepicker();     
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have successfully installed following items as i want to Integrate Facebook Chat Into
I'm trying to integrate Twitter with my App right now. I have successfully set
I have successfully integrate AdWhirl (v3.0) with AdMob in InMobi. Now when my app
I have integrate Twitter in my app successfully. But i couldn't post contents on
I successfully integrate sharekit into my app. At first, I was able to have
I am trying to integrate Flurry analytic in android app. I have integrate successfully
Have successfully gotten the csrf middleware working in express as per previous SO questions.
I have successfully bound a control to a property on my page. The property
I have successfully created a feature in sharepoint that modifies the existing edit dialog
I have successfully implemented a mysql server as a JDBCRealm for authentication in Tomcat

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.