to work, you have to have defined it earlier as it’s not a default function. Put this line somewhere before the init of the scheduler:
var html=function(id){ return document.getElementById(id); };
Next, you have to surround your custom form with a div tag with the id set as “my_form” for this call to work like so:
<div id="my_form">
//custom HTML code here
</div>
Also, at the very end of your code, you’re missing a semi-colon:
scheduler.attachEvent("onBeforeLightbox", function(id){
var ev = scheduler.getEvent(id);
if (ev && ev.start_date < (new Date())) {
alert("ERROR.");
return false;
}
return true;
}); //semi-colon added here
If you are using the same approach as in
samples\02_customization\16_custom_form.html
custom code replaces original showLightbox method and onBeforeLightbox event will never be triggered.