I cant get the datetime picker working.
In the layout partial I have
<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
In my view:
@{
ViewBag.Title = "Insert Task";
<script type="text/javascript">
$('#ActionDateTime').datetimepicker();
</script>
}
Here is my field
@Html.Label("Action Date") @Html.TextBox("ActionDateTime")
EDIT:
So the page source now looks like this after applying changes:
In the head I have : (this is linked correctly, clicking link opens js file)
<script src="/Scripts/jquery-ui-timepicker-addon.js" type="text/javascript"></script>
and the body I have :
<input id="ActionDateTime" name="ActionDateTime" type="text" value="" />
<script type="text/javascript">
$(document).ready(function () {
$('#ActionDateTime').datetimepicker();
});
</script>
Still not working.
datetimepickeris not part of the jQuery core library. You need to include this script along with the jQuery UI library.datetimepickerpluginhttp://trentrichardson.com/examples/timepicker/js/jquery-ui-timepicker-addon.js
jQuery UI library http://jqueryui.com/download
Include both in your head/or foot section where ever you have the reference to the jQuery library, BUT below the jQuery library reference.
Also include the jQuery UI stylesheet depending on the style you have selected.