hi,
it's the first time for me to work with jquery ui datepicker and it seems I don't understand the concept ;(
I get a timestamp from the server and i wnat to send a timestamp back to the server. I want to display a readable date into a text-input and append a datepicker to this textinput. What do I need to do this?
What I got managed up to now is the following:
-
$('#valid_date_from_datepicker').datepicker({
-
dateFormat: 'dd.mm.yyyy',
-
altField: '#valid_date',
-
altFormat: '@'
-
});
Now I receive to values from the server. The date as timestamp for a input[type=hidden] and an additional other value to display and use for the datepicker. When I klick into that field the callendar is shown, I klick a date and the textfield will be udateted with this date in the defined format on the one hand and the value of my alt field with a alt-Format also.
Works well ...
b
ut:
When I start open the datepicker the first time it has not the value of the field but the actual date. I tried following:
-
$('#valid_date_from_datepicker').datepicker('setDate', $('#valid_date_from_datepicker').val());
But this does change the Fields Value instead of the date into Datepicker and that can't be right.
but goes wrong here?
best,
heinetz