我有我的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