Solved

How Do You Add a Clickable Calendar Icon to the MVC Date Picker?

Posted on 2014-10-22
1
885 Views
Last Modified: 2014-10-27
My MVC 4 Calendar Control will only display a textbox that will bring up a calendar when it is clicked.  I need to add a clickable calendar icon to the right of the textbox.

My icon does not show.

My Code:

@Html.TextBoxFor(model => model.DateOfBirth, new { id="date-of-birth", @class = "form-control datepicker", type="Text", placeholder = "Enter Date" })

$(document).ready(function () {
      $('.datepicker').datepicker({
            format: "mm/dd/yyyy",
            autoclose: true,
            showOn: "button",
            buttonImage: "http://jqueryui.com/resources/demos/datepicker/images/calendar.gif",
            duration:0
      });
});

Thanks,

Dan
0
Comment
Question by:danielolorenz
1 Comment
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 40397666
check the generated html as it shoudl work : http://jsfiddle.net/bbc22ft5/
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question