1

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>
2
  • do you need a date set in the value attribute for when the datepicker appears? try rendering it with today's date for starters, or hardcoding in a dd/mm/yyyy value so it looks something like <input class='datepicker' type='text' id='4' name='4' value='01/01/2013' /> Commented Jan 25, 2013 at 15:38
  • I tried <input class='datepicker' type='text' id='4' name='4' value='1/25/2013' /> ...still getting the same error? Commented Jan 25, 2013 at 15:51

3 Answers 3

1

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

Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

0

Finally got the solution for this error

solution is we need to provide unique ids

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.