Detecting 'New Event' or 'Existing Event' onBeforeLightbox


When I create new event, or clicking existing event to open detail form,
I want to detect whether this is new event or existing event.
So if new event, my custom section field should be enabled
And if existing event, my custom field should be read only.

I guess I should use onBeforeLightbox event and form_blocks[‘myfield’].set_value,
But I don’t know any more.

lightbox form is not well suited for dynamical changes, but next can be done

from onBeforeLightbox check
based on its value you can set new
configuration and call
to apply it