我有我的web應用程序中顯示的jQuery UI日期選擇器,但是當我去選擇一個日期時,它不會執行任何操作。而默認的Html5 datepicker仍然顯示。jQuery UI datepicker不工作?
如何禁用HTML5的一個爲jQuery UI的日期選擇器的工作?
這是我做了我的代碼:
Create.cshtml
@Html.LabelFor(model => model.EnrollmentDate, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.EnrollmentDate, new { htmlAttributes = new { @class = "form-control", @id = "datepicker" } })
@Html.ValidationMessageFor(model => model.EnrollmentDate, "", new { @class = "text-danger" })
........
@section Scripts {
<script>
$(document).ready(function(){
$('#datepicker').datepicker({
dateFormat: 'dd-mm-yy'
});
});
</script>
@Scripts.Render("~/bundles/jqueryval")
}
我使用該鏈接爲我的代碼編寫腳本。 Chrome控制檯顯示錯誤,例如「jQuery ui','css' ...」無法加載資源......「 – Afton