<div id="dialogDiv"></div>
<div>
<a onclick='openPopup("/WEB-INF/views/template/dialog.jsp", "Add Address")' title="add value"></a>
</div>
dialog.jsp
<div class="loaddiv">
<form:form method="POST" commandName="address" id="dialogForm">
<form:input id="livingSince" path="livingSince" cssClass="datepicker"/>
</form:form>
</div>
的 common.js
$(function(){
$( ".datepicker" ).datepicker({
changeMonth: true,
changeYear: true,
showButtonPanel: true,
showAnim: 'fold'
});
});
//for pop up
function openPopup(url, title) {
$("#dialogDiv").load(url + " .loaddiv").dialog({
position: 'center',
modal: true,
resizable: true,
bgiframe: true,
autoOpen: true,
//height: 450,
width: 500,
title: title,
buttons: {
Save: function () {
$("#dialogForm").submit();
$("#dialogDiv").dialog('close');
//$("#dialogDiv").html('');
},
Cancel: function () {
$("#dialogDiv").dialog('close');
}
}
});
}
现在我的问题是在输入文本字段中单击后,对话框上没有显示datepicker。即使它完全在简单的jsp页面上工作,但不在对话框(弹出窗口)上。
我也试过这个解决方案,但它没有发生在我身上。
link