onChange for the period element in Lightbox

Hello,
I need to know when the user has changed the value of the “period” element in the lightbox.
ex : event at 3:00pm moved to 4:00pm.

This element’s type is ‘time’, so I guess I can’t use methods for select elements.

Is there an event triggered when this value is changed ?

I apologize if the question had already been answered.

Thank you !

Hi,
there are several ways, depending on what exactly you want to trace
If you need to capture changes in html inputs of time selectors, you can access their elements and manually add onchange handler to them, e.g.

[code]scheduler.attachEvent(“onLightbox”, function(){
var time = scheduler.formSection(“time”);

var selects = time.node.getElementsByTagName(“select”);

for(var i = 0; i < selects.length; i++){
selects[i].onchange = function(){
// do something
}
}

})
[/code]
docs.dhtmlx.com/scheduler/api__ … event.html
docs.dhtmlx.com/scheduler/api__ … ction.html

If you want to capture changes of the time of event objects before changes are applied, then you could go with onEventSave event

[code]scheduler.attachEvent(“onEventSave”,function(id, formEvent,is_new){

var oldEvent = scheduler.getEvent(id);

if(oldEvent.start_date.valueOf() != formEvent.start_date.valueOf() ||
    oldEvent.end_date.valueOf() != formEvent.end_date.valueOf()){
    // do something
}
if (!ev.text) {
    alert("Text must not be empty");
    return false;
}

return true;

})[/code]

docs.dhtmlx.com/scheduler/api__ … event.html