I have setup the JQuery Date picker in my MVC3 project, when I run the project, the date picker displays correctly, but when I select a date or try change the date or year, it throws the following error:
Microsoft JScript runtime error: Unable to set value of the property 'currentDay': object is null or undefined
it is thrown on this bit of code in the jquery UI file:
mrThirsty
0 Points
1 Post
JQuery Date Picker is not working
May 13, 2012 09:10 AM|LINK
I have setup the JQuery Date picker in my MVC3 project, when I run the project, the date picker displays correctly, but when I select a date or try change the date or year, it throws the following error:
f.selectedDay=f.currentDay=d("a",e).html();<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>and my view that actually uses the date picker:<script type="text/javascript"> $(document).ready(function() { $(".pickDate").datepicker();}); </script>@Html.TextBoxFor(model => model.Match_Date, new { @class="pickDate"})Anyone know how I can get around this issue?JQuery RAZOR datepicker mvc3
Ken Tucker
All-Star
16797 Points
2608 Posts
MVP
Re: JQuery Date Picker is not working
May 13, 2012 11:08 AM|LINK
I do not see a currentDay property in the date picker. There is a currentText
http://jqueryui.com/demos/datepicker/#option-currentText
JQuery RAZOR datepicker mvc3
Space Coast .Net User Group
Jo em
Member
30 Points
17 Posts
Re: JQuery Date Picker is not working
May 13, 2012 11:11 AM|LINK
Hi mrThirsty,
you can set the date from codebehind like this,
[HttpGet] public ActionResult Create() { FooModel model = new FooModel { Foo = new Foo { Date = new DateTime(2012, 13, 05)}}; return View(model); }