A select dropdown. Whats the best event for this situation?
Posted on 2004-08-24
Imagine a select list with some options. When you select a particular option, a window might popup, or it might not, some options don't pop up a window, but in this case lets say it does, and you fill out some info. When you click done, the window closes, and some of the data you filled out is used to create a new option in the list, and set it as the selected option.
Right now, I have an onchange event looking to pop up the window. If the value of the select list is a certain thing, the window will pop up.
The problem comes when a person pops up the window, closes it (or loses it) and tries to do it again. Since the option is already selected, there is no change event, thus no popup.
I should also note that to find the box that popped up the window, I check for a select box with the value of the option that I know pops up windows. I was thinking of doing an onunload on the popup and setting it back to "Choose Options" (first option in the list) but that would change the select list even if they filled out the form and clicked done. Blah....