5

i am Struggling with onchange for JQuery ui timepicker plugin: http://trentrichardson.com/examples/timepicker/

I am using the following code.

$(document).ready(function ()
{
    $('#CutoffTime').timepicker({ stepMinute: 15 });
});

// Trying to catch the change event

$(function ()
{
    $('#CutoffTime').change(function ()
    {
        // do something heree
    });
});

// my HTML

<input type="text" id="CutoffTime" />

For some reason it seems to go in an infinite loop? is there a better way of achieving what i need?

user1358918
  • 105
  • 2
  • 2
  • 4

1 Answers1

8

If you look farther down the page they have an example that uses onselect

$('#CutoffTime').datetimepicker({
    stepMinute: 15,
    onSelect: function(dateText, inst){
        if(window.console)
            console.log(dateText);
    }
});
grdaneault
  • 830
  • 1
  • 11
  • 21
  • Don't work for me, no javascript errors, simply function is not being executed, any reason why that would be? – K.I Feb 17 '17 at 23:38