Display the date that was selected with Jquery
- I have a date picker as below which is not bringing back the date that was picked by the user, instead it is bringing back the latest month and the year. How can i change the function so that it always brings back the date that was saved in the database or the date that was selected.
-
- thanks
-
-
- <script>
-
- $(document).ready(function () {
- $(".datepicker").datepicker({
- showOn: 'both',
- dateFormat: 'dd-mm-yy',
- showButtonPanel: true,
- constrainInput: false,
- buttonImage: "../jquery-ui-1.11.4.custom/images/calendarNew.gif",
- buttonText:"Please select a date",
- buttonImageOnly: true,
- closeText: 'Clear', // Text to show for "close" button
-
-
- onClose: function () {
- var event = arguments.callee.caller.caller.arguments[0];
- // If "Clear" gets clicked, then really clear it
- if ($(event.delegateTarget).hasClass('ui-datepicker-close')) {
- $(this).val('');
- }
- }
- });
-
- });
-
-
-
- </script>
As you can see above today's date is picked instead of reverting back to June 23.