我有一个日期选择器,如下所示没有带回用户选择的日期,而是带回最新的月份和年份。如何更改功能,以便始终返回保存在数据库中的日期,或者用户在输入字段上选择的日期而不是原始日期。This is what the function is returning as of now
<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>
<style>
img.ui-Datepicker-trigger {
position: relative;
left: -25px;
top: 2px;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<input name="Date" id="Date" class ="datepicker" value="#dDate#" onChange="setFormChanged(this);"/> <font color="Teal" size="-2"> {dd/mm/yyyy} #dOccDate# </font>