【发布时间】:2016-11-02 12:49:44
【问题描述】:
我使用 jquery jquery-1.9.1.min.js。我有以下带有日期选择器的jsp
<script type="text/javascript">
$( function() {
$( "#datepicker1" ).datepicker({
changeMonth: true,
changeYear: true,
defaultDate: new Date('2016','11','02'),
setDate: new Date('2016','11','02')
});
} );
</script>
</head>
<body>
<%@include file="../menu/cabeceraMenu.jsp"%>
<%@include file="../menu/opcionesEncuesta.jsp"%>
<form action="${pageContext.request.contextPath}/encuesta/nueva"
name="frm" id="nueva-encuesta" method="post" style="margin: 0px;">
<table class="tablaCentral">
<tr>
<td>
Date: <input type="text" id="datepicker1">
</td>
</tr>
</table>
</body>
</html>
这是输出画面
如何在屏幕下拉框中显示月份名称和数字年份。现在它们是空的。
日期是 新日期('2016','11','02') 我想设置 11 月和 2016 年的盒子
【问题讨论】:
-
您使用哪个版本的 jquery UI?和主题?
-
jquery-1.9.1.min.js
-
只有jquery没有datepicker,需要的话必须使用jquery UI和主题! (就像你回答@CharantejGolla)
-
我将 jquery-ui.js 用于 jquery-1.9.1.min.js。有必要使用主题吗?
标签: jquery datepicker dropdown monthcalendar