lundi 13 novembre 2017

Uncaught TypeError: $(...).datepicker is not a function in ruby on rails 3

Hi I am trying to show date picker icon near the date input field. When i am loading the screen, the date picker not showing. And it shows " Uncaught TypeError: $(...).datepicker is not a function " error in my console.Please help me to solve this issue..Thanks in advance..!

this is my function :

setTimeout(function(){
    jQuery(function() {

      var pickerOpts;

      var dateToday = new Date();

      jQuery(function($) {

        pickerOpts = {

          showOn: "button",
          buttonImage: "/assets/cal_icon.png",
          buttonImageOnly:true,
          changeMonth: true,
          changeYear: true,
          dateFormat: "dd-mm-yy",
         // minDate: dateToday,
          id:"cal"

        };
        $("#pay_date").datepicker(pickerOpts);

      });

    });
  },200);

});

Aucun commentaire:

Enregistrer un commentaire