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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:35:48+00:00 2026-06-12T12:35:48+00:00

I have two input text-fields, an effective date and an expiration date. I’m using

  • 0

I have two input text-fields, an “effective date” and an “expiration date.” I’m using jquerytool’s dateinput function as the date-picker.

Question:
When the “effective date” is picked, I’d like the “expiration date” to be one-year from the “effective date” and to set that value to the “expiration date” text-input field.

I cannot seem to get this all working…

<script>

$(document).ready(function() {

  $(":date").dateinput({
    format: 'mmmm dd, yyyy', // the format for example: 'October 04, 2012'
  });

function expiration (){
  // date calculations here?...
  ...
  document.getElementById('expiration').value = expirationDate;

}
</script>


<input type="date" name="effective" id="effective" onChange="expiration()" />

<input type="date" name="expiration" id="expiration" />
  • 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-12T12:35:50+00:00Added an answer on June 12, 2026 at 12:35 pm
    <script>
    
    function expiration (){
      // date calculations here...
      var effectiveDate = document.getElementById('effective').value;
    
      var expirationDate = new Date(effectiveDate);
    
      expirationDate.setDate(expirationDate.getDate()+365);
    
      document.getElementById('expiration').value = expirationDate;
    
    }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this function which i am using to compare two input fields. If
I have a form with two input text fields: <input id=ModelName_test_0 name=ModelName[test][0] type=text> <input
I have an HTML5 Canvas on my page along with two text input fields.
I have two text input fields: Name:<input id=name type=text value= name=username> Age:<input id=age type=text
I have two fields: <input type=text name=zip id=zip value= /> <select name=state id=state> <option
I have two inputs (text fields) required by JQuery Plug-in : <input type=text name=first_name
I have a simple form and inside there are two input fields text type.
I have four input fields two text and two hidden. The HTML: <input type=text
I have two fields, one of them is a text input field and the
I have two fields <form action=insert.php method=post> Firstname: <input type=text name=firstname /> Lastname: <input

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.