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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:08:11+00:00 2026-06-08T00:08:11+00:00

I am having an issue with the JQuery datepicker and the forward and back

  • 0

I am having an issue with the JQuery datepicker and the forward and back buttons in the browser.

I have two text fields, one that is a “date” field and one field that is just a regular text input. On page load, I initialize the datepicker with the following code:

$(document).ready(function() {
      $('#date').datepicker()
      $('#date').datepicker("setDate",new Date())
});

The page shows up fine, and the datepicker has the correct date in it. Everthing works as intended, but if I press the browser’s back button, and then the forward button (bringing me back to the same page) the text field that was empty is now filled in with what was in the datepicker box.

For reference, here is the relevant html snippet

  <body>
    <p>
      Here I will have two text boxes, one datepicker and one regular
    </p>
    <input type="text" id="notdate"/>
    <input type="text" id="date"/>
  </body>

Goal:
I need the date box to show up with the date already there, as text and I want to get rid of the input duplication on forward/back reloads of the page.

Note: if you change the other text box before pressing back/forward everything is fine. Hopefully there is a less hacky way to fix it than to touch all of the boxes as the page is loaded. =]

  • 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-08T00:08:12+00:00Added an answer on June 8, 2026 at 12:08 am

    A correct workaround was provided by Julian. Giving the text fields name attributes seemed to clear up the problem. Not sure why this works considering divs are identical, but it did solve the problem.

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

Sidebar

Related Questions

I'm having an issue with two jQuery calls. The first is a load that
I am having an issue with jquery tablesorter I have a column that I
Having an issue with traversing in jQuery.. hopfully an easy one..but I'm banging my
I'm having an issue with the date input from jQuery Tools. When I click
I am having an issue trying to deal with timezones in the JQuery date/time
I am having an issue with jQuery templates. I have a simple template each
I am having issues with ie 8 compatibility mode. I have some buttons that
I'm having an issue with multiple jQuery UI dialogs. What I want is that
Having an issue with one my scripts. The animation keeps queueing up. I have
I'm having an issue with JQuery and JSF/Richfaces. I have an inputText component inside

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.