user3427399
user3427399

Reputation: 3

Adding a Date Picker Bootstrap 3 on MVC 5 project

I was just looking at How to add Date Picker Bootstrap 3 on MVC 5 project using the Razor engine?

But it failed for me, I got the error:

Unhandled exception at line 48, column 8 in http://localhost:10234/Venue/Edit/6a83811c-7a36-41f8-bc8e-8371d01f606e

0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'datepicker'

The script I used is: $(function () { // will trigger when the document is ready $('.datepicker').datepicker(); //Initialise any date pickers });

With the highlighted text: $('.datepicker').datepicker()

This is how I declared the text box... @Html.TextBoxFor(model => model.DateFrom, new { @class = "form-control datepicker", placeholder = "Enter date from here" } )

I expect that I have a simple setup error as I am new to Date Picker and Bootstrap

Any advice would be greatly appreciated - Thank You

Upvotes: 0

Views: 1987

Answers (1)

Jelle Oosterbosch
Jelle Oosterbosch

Reputation: 1742

The datepicker is from the jQuery UI library. Have you included this one?

Upvotes: 1

Related Questions