Solved

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

Posted on 2014-10-22
1
853 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

by Julian Matz As of jQuery (http://jquery.com/) 1.4 the .live() method (http://api.jquery.com/live/) supports custom events as well as some standard JavaScript events that it previously didn't support. Among these is the submit event. Unlike …
In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now