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

  • Home
  • SEARCH
  • 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 8022823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:22:58+00:00 2026-06-04T22:22:58+00:00

I use the jQuery Datepicker for two different text fields. One field for start

  • 0

I use the jQuery Datepicker for two different text fields. One field for start date and another for end field. I disable date before current date using minDate. My code is like this:

$( "#start" ).datepicker({
    minDate: 0,
    dateFormat: 'yyyy-mm-dd',
    showOnFocus: true,
    showTrigger: '<img src="<?php echo base_url()?>images/calender.png" />'
});    

$( "#end" ).datepicker({
    minDate: 0,
    dateFormat: 'yyyy-mm-dd',
    showOnFocus: true,
    showTrigger: '<img src="<?php echo base_url()?>images/calender.png" />'
}); 

Now I need to check that end date must be equal to or greater than start date. And in the end date field, all dates before the start date selected must be disabled. How can it be done?

  • 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-04T22:22:59+00:00Added an answer on June 4, 2026 at 10:22 pm

    Firstly thanks to all who help me to find the answer.

    Solution for my question is by using following codes:

    $(document).ready(function(){
      $("#depart ,#return_date").datepick({
        minDate:0,
        dateFormat:'yyyy-mm-dd',
        showOnFocus: true,
        showTrigger: '<img src="<?php echo base_url()?>images/calender.png" />',
        onSelect: customRange
      });
    
      function customRange(dates) {
        if (this.id == 'depart')
        {
          $('#return_date').datepick('option', 'minDate', dates[0] || null);
        }
        else
        {
          $('#depart').datepick('option', 'maxDate', dates[0] || null);
        }
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are two input fields of type text to write a start date and
I use JQuery Datepicker and cannot get data from it. In .html: <p>Date: <input
i use jQuery datepicker. i disabled input text and wanted use it as simple
I'm trying to use the jQuery Datepicker and a JavaCcript scrollbar on one page.
I want to use datetime picker in 4 text box. JQuery datepicker for 4
I'm trying to use the jquery datepicker (the ajax control toolkit one will not
I'm trying to attach a JQuery datepicker to a text field on a form,
I use jQuery datepicker and need one with the years select element. This is
I use jquery_datepicker gem for selecting date in my form. However, datepicker passes param
I'm usung the jQuery datepicker. In my EndDate textbox I'd like to use 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.