I use AJAX "autosuggest": the user enters a line in the input text box, a hidden div with a table is displayed, and then he can click on the line or scroll the list up / down arrows; in the meantime, focus is still in the input text box.
Everything works mostly fine, but there are details that I cannot implement that seem conceptually difficult or even impossible. I would like to hide the list of offers when the user moves the cursor to another input field or simply clicks on an empty point in the window. This is not difficult to do on its own, I just added calback OnBlur; but this violates the selection of the OnClick element, since the onblur event is fired before the click, and then the DIV disappears before the onclick event is fired ...
I thought about implementing an onclick callback for the whole window, and then checking where the click occurred, but this seems too awkward and distorted. Anyone have a better idea? Thanks!
source share