I have a form similiar to the example below.  There is a default date
of, say, January 1, 2005.  I want the date format to be "yy-mm-dd".

Problem #1: On page load, I instead get today's date populated in the
field. It seems setting any option causes the date to be set to
today's date.

Problem #2: On page refresh, Firefox autopopulates the form with the
last user set value.  i.e., if I go ahead and pick "2005-01-01" and
hit Forward and then Back on the browser, I should expect "2005-01-01"
to be autopopulated by Firefox, except this is also overridden by
Datepicker to today's date on page load.

<html>
  <head>
    <script type="text/javascript" src="http://ajax.googleapis.com/
ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/
ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
    <link type="text/css" rel="Stylesheet" href="http://
ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/start/jquery-
ui.css"/>
  </head>
  <body>
    <form><input id="testDate" type="text" value="2005-01-01" /></
form>
    <script>
      $(function() {
        $('#testDate').datepicker();
        $('#testDate').datepicker('option', { dateFormat: "yy-mm-
dd" }); //this is the line causing the problem
      });
    </script>
  </body>
</html>


--

You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to jquery...@googlegroups.com.
To unsubscribe from this group, send email to 
jquery-ui+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en.


Reply via email to