Event hook for after lightbox loads?

Hello,

I’m having a problem with a custom dropdown I added to the details lightbox. The problem is this: the first time the lightbox loads, the option in the dropdown with the SELECTED attribute is the default (selected) option. If the user changes the dropdown selection, saves the event, then creates another event with the details lightbox WITHOUT reloading the page, the last selected option is what is selected when the lightbox renders. (There is dynamic lightbox form sections that are displayed/hidden based on the option selected, and the wrong event being selected when the lightbox loads is throwing that off, too.)

I’m guessing that this is because the DOM hasn’t changed from the previous time the lightbox was displayed, so when the lightbox is shown again the previous setting is what is used. If this is true, I’m assuming I could use some event hook that fires after the lightbox is shown that does something like

document.getElementById(appttype_selection_id).selectedIndex(0);

…where appttype_selection_id is a global var I have that contains the ID of the selection control, setting the selection back to the first option.

I tried doing this with the onAfterLightbox and onFullSync events, but neither did the trick. Am I on the right track? Any recommendations are appreciated.

Thanks as always,
Chris

with a custom dropdown I added to the details lightbox.
So you are using custom form section, right?
In such case you can add logic to set_value method

set_value:function(node,value,ev){ if (typeof value == "undefined") value = "default value"; //default selected option node.firstChild.value=value||""; },

In such case it will show selected option for already existing events, and default option for new events.

I tried doing this with the onAfterLightbox and onFullSync events
onAfterLightbox is appropriate event, which can be used to change state of html element back to default value, it will be called when form already closed.
I’m not quite sure about code which you are using, I think a correct one will be

document.getElementById(appttype_selection_id).selectedIndex=0;