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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:37:36+00:00 2026-05-28T01:37:36+00:00

How to do this using jQuery i have a select like <select id=Plan_Id name=Plan_Id>

  • 0

How to do this using jQuery

i have a select like

<select id="Plan_Id" name="Plan_Id">
    <option value="30">Month</option>
    <option value="365">Annual</option>
</select>

then i have a input

<input name="date" id="date_picker" type="text" class="text date_picker" />

so based on the option i select i want to get the date today + value and show on the input was

m-d-Y.

so if today is january 07 and i select 30 -> month

my input will be populated with 02-06-2012

  • 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-28T01:37:37+00:00Added an answer on May 28, 2026 at 1:37 am

    Rather than general googling, you want to look specifically at a JavaScript reference about the Date object and at the jQuery UI datepicker reference. Between the two you’ll have all the information you’ll need to work this out. But since I already happen to know the answer (or an answer)…

    Given a JavaScript date object:

    var today = new Date();  // current date returned by constructor with no params
    

    You can add n days to it by setting the day-of-the-month to the current value plus n – the month and/or year will be automatically adjusted as appropriate. So:

    today.setDate(today.getDate() + 30);
    today.setDate(today.getDate() + 365);
    

    Put together with the jQuery datepicker “setDate” method:

    var theDate = new Date();
    
    theDate.setDate(theDate.getDate() + 365);
    
    $("#date_picker").datepicker("setDate", theDate);
    

    Demo: http://jsfiddle.net/WUdWs/1/

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

Sidebar

Related Questions

let's say i have list looking like this: <select name=name id=id> <option value=10176232332>David</option> <option
I have regular form like this. <form action=/domainchecker.php method=post> <input type=text name=domain size=20> <fieldset>
I have a select list like such: <select name=taxonomy[1][] multiple=multiple class=form-select id=edit-taxonomy-1 size=7> <option
I am using jquery validation plugin. I have an html that looks like: <h2>Select
Hi I have a select like: <select id=item_OfficeUserId class=dropdownauditor name=item.OfficeUserId invoicelineid=33> In jQuery I
I have a select list like so: <select id=drpColours> <option value= selected=selected>Choose color</option> <option
I have a select element. This element is looped over using jquery, any options
I have this strange issue with my web app. You see, I'm using jQuery
I am using the jQuery $.ajax() function. I have put this into a parent
I have a simple html option/select (dropdown) menu. I want to use JQuery to

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.