Open JQuery Datepicker by clicking on an image w/ no input field

后端 未结 8 924
夕颜
夕颜 2020-11-27 13:00

I want to have the JQuery Datepicker open when the user clicks on an image. There is no input field where the selected date appears afterwards; I\'m just going to save the e

8条回答
  •  -上瘾入骨i
    2020-11-27 13:47

    $(function() {
       $("#datepicker").datepicker({
           //showOn: both - datepicker will come clicking the input box as well as the calendar icon
           //showOn: button - datepicker will come only clicking the calendar icon
           showOn: 'button',
          //you can use your local path also eg. buttonImage: 'images/x_office_calendar.png'
          buttonImage: 'http://theonlytutorials.com/demo/x_office_calendar.png',
          buttonImageOnly: true,
          changeMonth: true,
          changeYear: true,
          showAnim: 'slideDown',
          duration: 'fast',
          dateFormat: 'dd-mm-yy'
      });
    });
    

    The above code belongs to this link

提交回复
热议问题