Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add calendar jquery image to datepicker

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.

like image 844
user525146 Avatar asked May 02 '12 20:05

user525146


2 Answers

<script>
        $(function() {
            $( "#datepicker" ).datepicker({
                showOn: "button",
                buttonImage: "http://jqueryui.com/resources/demos/datepicker/images/calendar.gif",
                buttonImageOnly: true
            });
        });
</script> 
like image 99
coder Avatar answered Oct 04 '22 01:10

coder


If you click the view source button below the example you linked to, you'll see something like this:

$('#field').datepicker({        
    buttonImage: '/images/calendar_icon.png'
});
like image 32
ContextSwitch Avatar answered Oct 04 '22 01:10

ContextSwitch