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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:16:31+00:00 2026-05-19T12:16:31+00:00

What I want to do is when the starting date is selected in the

  • 0

What I want to do is when the starting date is selected in the first dropdown, the ending date dropdown automatically jumps to the same date.

Just like in JAL website. Best Example-> http://www.jal.co.jp/

All I could find were stuffs like below but this is not what I want to do.

-http://stackoverflow.com/questions/1974798/javascript-how-to-make-auto-select-another-drop-down

-http://jsajax.com/EditRunDemo.aspx

-http://stackoverflow.com/questions/1966407/how-to-populate-dropdown-with-dynamic-date-based-on-2-other-dropdown-boxes

Does anybody know how to do this?
Please give me some advise….

I’m using rails and jquery, so anything that goes along with them would be great! Thanks!

  • 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-19T12:16:32+00:00Added an answer on May 19, 2026 at 12:16 pm

    I use 2 input with type text (from_date and to_date), but it’s the same deal as with a dropdown. they look like this:

    <div>From: <%= text_field_tag :from_date, params[:from_date],:class => "date" %> </div>
    <div>To: <%= text_field_tag :to_date, params[:to_date],:class => "date" %> </div>
    

    then, using jquery and the datepicker plugin i do this:

    <script type="text/javascript">
       $(document).ready(function() {
    
         $( ".date" ).datepicker({
           dateFormat: 'mm-dd-yy'
         });
    
         $("#from_date").change(function() {
           var d = $("#from_date").val();
           $("#to_date").val(d);
         })
    
       });
    </script>
    

    as you can see, I’m setting the date format options for the datepicker, and checking to see when something changes in the from_date box. if something changes (i picked a date from the calendar), the contents get copied in the second box (to_date).

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

Sidebar

Related Questions

Starting with : 2011-01-17 09:30:00 Let's say I want to edit just the date
I want to do something like this strtotime(next starting minute); If the current time
I only want the dates starting from the current date. How do I ask
i'm just starting to learn about database design. For my first project I made
I am just starting to learn jQuery, and want to load content from a
I want a certain job executed every 4 days starting from a start date
I wrote some very simple code since I'm just starting C++ and I want
I want to get the starting and ending dates of a week for example
I am starting using logback and I want to know if there are better
I want to create a single button which serves both functions of Starting and

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.