Home Ask Login Register

Developers Planet

Your answer is one click away!

khushbu February 2016

datepicker is not working in mvc4

I beginner in mvc Going to create application.I want to display datepicker in my application on textbox.I have written code in view .cshtml

<link href="~/Content/themes/base/minified/jquery.ui.datepicker.min.css" rel="stylesheet" />
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"/>
<link rel="stylesheet" href="/resources/demos/style.css">


    $(document).ready(function () {
<input type="text" id="date" />

When I click on textbox it is not working Please help if anyone have any idea about this.


Ognjen Babic February 2016

Include jQuery UI in your script, add class="datepicker" where you want your datepicker to apear, and add this function:

$(function() {
    $( ".datepicker" ).datepicker();


Post Status

Asked in February 2016
Viewed 1,380 times
Voted 12
Answered 1 times


Leave an answer

Quote of the day: live life