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

后端 未结 8 951
夕颜
夕颜 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条回答
  •  半阙折子戏
    2020-11-27 13:42

    If you are using an input field and an icon (like this example):

    
    
    

    You can attach the datepicker to your icon (in my case inside the A tag via CSS) like this:

    $("#Hasta").datepicker();
      $("#Hasta_icono").click(function() { 
       $("#Hasta").datepicker( "show" );
      });
    

提交回复
热议问题