Click here to Skip to main content
15,881,744 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi to all,
how to set datepicker in mvc 5. Here i using JqueryUiHelper in package manage console and another method i used jqueryui (combined) library.Here i using many methods but no use can u help me please.Can anybody help how to create simple Date Picker Explain me please.
Posted

Have you seen the documentation?

http://jqueryui.com/datepicker/[^]

Click on view source and you will see an example.
 
Share this answer
 
Comments
JOTHI KUMAR Member 10918227 31-Jul-14 1:54am    
hey i tried this also.if i used JqueryUiHelper in package manage console. i got an error no directory found.or if i used jqueryui (combined) library the design of my view should changed but not apply datepicker in textbox
Jesús López Méndez 31-Jul-14 3:19am    
It's dificult to answer if you don't show the view. Using datepicker is easy and straightforward. Perhaps jquery and jquery ui are not loaded. The css files are not loaded. The datepicker function is not called?.
Hi,

Make sure that you have added a reference to these files in your HTML

HTML
<link href="~/Scripts/jquery-ui-1.11.0.custom/jquery-ui.min.css" rel="stylesheet" />
<script src="~/Scripts/jquery-1.10.2.min.js"></script>
<script src="~/Scripts/jquery-ui-1.11.0.custom/jquery-ui.min.js"></script>


Html code will be,
HTML
<div class="row">
    Date: <input type="text" id="picker">
</div>
<!-- create datepicker whenever you need, i'm creating on document ready-->
<script>
  $(document).ready(function () {
        $("#picker").datepicker();
    });
</script>


Hope this will help you..
 
Share this answer
 
Comments
JOTHI KUMAR Member 10918227 31-Jul-14 3:15am    
design should be changed and datepicker not applied
Murali Gowda 31-Jul-14 3:19am    
Is that datepicker style should be changed? With above code datepicker will be created with default style.
JOTHI KUMAR Member 10918227 31-Jul-14 3:40am    
not datepicker design my design should be collapsed. for using new datepicker what are all package to be installed and how to create i want this step by step
Murali Gowda 31-Jul-14 4:47am    
If you are using JQueryUI, you need to have jquery-ui.min.css,jquery-ui.min.js (which you can downlod from http://jqueryui.com/download/) and jquery-1.10.2.min.js (http://jquery.com/download/) no package is required to instal.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900