Add calendar jquery image to datepicker

user525146 picture user525146 · May 2, 2012 · Viewed 70.2k times · Source

I am not sure how to add the ui-icon ui-icon-calendar class as a datepicker image beside the text field. I want something like this: http://jqueryui.com/demos/datepicker/#icon-trigger, but it should have the jquery calendar image.

Answer

coder picture coder · May 2, 2012
<script>
        $(function() {
            $( "#datepicker" ).datepicker({
                showOn: "button",
                buttonImage: "http://jqueryui.com/resources/demos/datepicker/images/calendar.gif",
                buttonImageOnly: true
            });
        });
</script>