form
実際、Spring アプリケーションでは、jsp コードでspring ベースのタグを使用しています。
このための機能を追加し、<form:input>
Jquery を使用して DatePicker を提供します。
そして、ここに私のJspコードがあります..
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<link rel="stylesheet" href="resources/css/jquery-ui.css" type="text/css">
<link rel="stylesheet" href="resources/css/custom.css" type="text/css">
<script type="text/javascript" src="resources/jquery/jquery-ui.min.js"></script>
<form:form action="form/form1"
modelAttribute="form1">
<label class="control_label_c">From : </label>
<div class="controls_c">
<form:input type="text" path="fromDate" class="date-picker" />
</div>
</form:form>
<script>
$(function() {
$('.date-picker').datepicker( {
changeMonth: true,
changeYear: true,
showButtonPanel: true,
dateFormat: 'MM yy',
onClose: function(dateText, inst) {
var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val();
var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val();
$(this).datepicker('setDate', new Date(year, month, 1));
}
});
});
</script>
しかし、日付ピッカーが機能していません (表示されません)...
このスプリング ベースのフォーム タグに問題はありますか? また
私のコードに何か問題がありますか?