I need help finishing my custom built ajax [div] based dynamic dropdown.
Basically, I have an [input] box which; onkeyup, runs an Ajax search which returns a bunch of results in divs and are drawn back in using innerHTML. These divs all have highlights onmouseover so, a typical successfull search yields the following structure (pardon the semicode):
[input]
[div id=results] //this gets overwritten contantly by my AJAX function
[div id=result1 onmouseover=highlight onclick=input.value=result1]
[div id=result2 onmouseover=highlight onclick=input.value=result2]
[div id=result2 onmouseover=highlight onclick=input.value=result2]
[/div]
It works.. beautifully! looks elegant and is way more complete than any regular dropdown (those results div bring in a lot of information).
However, I'm missing the most of important functions behind regular HTML elements, that is, I can't keyboard down or up between "options". How do I do this? I know javascript handles keyboard events but; I haven't been able to find a good guide on how to do this. (of course the follow up question to this will eventually end up being: "can I use to trigger that onclick event)
Phew!
Cheers,
/mp