Search code examples
jquerydatepickerlive

jQuery Tools Dateinput with live function


I am using jQuery Tools Dateinput script http://jquerytools.org/demos/dateinput/index.html for date picker.

$('.inputDate').dateinput({
    format: 'yyyy-mm-dd'
});

I am cloning this input field so I have to use live function. Currently, after cloning I am using this function

    $('.dateDiv:last').find('.inputDate').dateinput({
        format: 'yyyy-mm-dd'
    });

It works perfectly fine but I was just wondering if I can use something like this

$('.inputDate').live('focus', function(){
   ???
});

Solution

  • You could do this

    $('input.datePick').live('focusin', function() {
       $(this).datetime(); 
    });
    

    Hope this helps