i have the following view with textbox attached with jquery datepicker
, this shows the text box with DOB button next to it with datetime
format label but when click button or click on the textbox it does not show the datepicker
. How do i fix this?
@model dtTest.OrderTime
@{
ViewBag.Title = "Edit";
}
<h2>Edit</h2>
@using (Html.BeginForm()) {
@Html.ValidationSummary(true)
<fieldset>
<legend>OrderTime</legend>
@Html.HiddenFor(model => model.id)
<div class="editor-label">
@Html.LabelFor(model => model.TimeZone)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.TimeZone)
@Html.ValidationMessageFor(model => model.TimeZone)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.TimeUTC)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.TimeUTC)
@Html.ValidationMessageFor(model => model.TimeUTC)
</div>
<p>
<input type="submit" value="Save" />
</p>
</fieldset>
}
<div>
@Html.ActionLink("Back to List", "Index")
</div>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
<script>
$('document').ready(function () {
$('#TimeUTC').datepicker({
appendText: 'mm/dd/yyyy',
showOn: 'both',
buttonText: 'DOB',
dateFormat: 'dd/dd/yy',
changeMonth: true,
changeYear: true,
minDate: new Date(2000, 0, 1),
maxDate: new Date(2005, 0, 1)
});
});
</script>
}
my layout file adds the jqueryui bundle
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>@ViewBag.Title</title>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
</head>
<body>
@RenderBody()
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/jqueryui")
@RenderSection("scripts", required: false)
</body>
</html>
bundle files are:
public class BundleConfig
{
// For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
"~/Scripts/jquery-ui-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.unobtrusive*",
"~/Scripts/jquery.validate*"));
}}
when i click the textbox the browser throws the following error in the console (chrome)
here is my scripts folder: