Solved

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

Posted on 2014-10-22
1
980 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Review of the nodejs code 1 56
Make check boxes work 8 59
Toggle a div with a button and timer with jQuery 4 24
Check for Numeric Phone Field 14 45
PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
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)
Suggested Courses

737 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