Datepicker - How to display a pre-filled input field?

Datepicker - How to display a pre-filled input field?

Hi all,


I have one Problem with datepicker, that I cannot solve.
I try to write a pre-filled value into the Input field, before I Chose a date in the datepicker. The data should be overwritten by chosing in datepicker. But when I add the field´s id, it won´t Display anything, except of the date, I chose.


  1. <!doctype html>
    <html lang="en">
    <head>
    <meta charset="utf-8">
    <title>jQuery UI Datepicker - Format date</title>



  2. <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>

  3. <script>
    $(function() {
     $( "#datepicker" ).datepicker({ changeMonth: true, changeYear: true });
     $( "#datepicker" ).datepicker( "option", "dateFormat", "dd.mm.yy" ); 
     $( "#datepicker" ).datepicker( "option", "monthNamesShort", [ "Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez" ] );
     $( "#datepicker" ).datepicker( "option", "showMonthAfterYear", false );
     $( "#datepicker" ).datepicker( "option", "yearRange", "1924:2014" ); 
    });
    </script>
    </head>
    <body>









  4. <p>Date: <input type="text" id="datepicker" size="30" value="prefilledValue"></p>
    </body>
    </html>

How can I get the Information into the Input field?

Thank you in Advance