ASP.NET MVCにかみそりで日時ピッカーを使用しています。送信されたフォームに検証エラーメッセージが表示されると、入力した値が保持されず、ピッカーが機能しなくなります。検証エラーが発生した後、ピッカーコントロールを再利用することは可能ですか?
ピッカーに関する私の見解:
<div class="editor-label">
@Html.LabelFor(model => model.StartDateTime)
</div>
<div class="editor-field">
@Html.TextBox("Start", null, new { @class = "date" })
@Html.ValidationMessageFor(model => model.StartDateTime)
</div>
jqueryピッカーコントロール:
<script src="/Scripts/mobiscroll-2.0.1.custom.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
var now = new Date();
$('#Start').scroller({
preset: 'datetime',
minDate: new Date(now.getFullYear(), now.getMonth(), now.getDate()),
theme: 'ios',
display: 'modal',
mode: 'scroller'
});</script>