Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • How would you reflect this change in the .cshtml file? Would you remove the .EditorFor() call and statically insert a Text Box?
    – JSK NS
    Commented Jan 27, 2014 at 23:32
  • Try firstly with adding the attribute I suggested, it seems to be the easiest solution Commented Jan 27, 2014 at 23:36
  • I did that, Date Picker still displays as it does in the screenshot in my question.
    – JSK NS
    Commented Jan 27, 2014 at 23:36
  • Change your editor for to : @Html.EditorFor(model => model.ToDate, new { id = "toDate"}); And then $( "#toDate" ).datepicker( "setDate", new Date()); Commented Jan 27, 2014 at 23:37
  • The problem is not the jQuery, its the .EditorFor() call adding type='date' attribute to the HTML attribute.
    – JSK NS
    Commented Jan 27, 2014 at 23:42