Chaka
Chaka

Reputation: 1541

Datepicker issue when implementing in mvc3?

Using Mvc3 razor. I tried to implement the Jquery data picker with an inputbox on my form, I am getting this exception "Microsoft JScript runtime error: Unable to set value of the property 'currentDay': object is null or undefined" when I click on a date on the calendar.

Jquery:

 $(document).ready(function () {           
      $(".datepicker").datepicker();
 });

Html :

<div class='answer'>
  <input class='datepicker' type='text' id='4' name='4' value='' />
</div>

Upvotes: 1

Views: 888

Answers (3)

Sandeep
Sandeep

Reputation: 613

Finally got the solution for this error

solution is we need to provide unique ids

Upvotes: 0

Chaka
Chaka

Reputation: 1541

I figured out that the date field has a same id of another input field. They need to be unique.

Upvotes: 1

t0ne
t0ne

Reputation: 159

In a simple test your code works outside of the MVC3 framework, so I would check the versions of JQuery/JQuery UI being included when the page is actually rendered.

Upvotes: 0

Related Questions