Try these three DOM methods in concert: http://developer.mozilla.org/en/docs/DOM:document.createEvent http://developer.mozilla.org/en/docs/DOM:event.initKeyEvent http://developer.mozilla.org/en/docs/DOM:element.dispatchEvent
If you're able to get it to work, the event that gets generated and dispatched will only differ from a genuine event in that it has a property called isTrusted set to false. This is a security precaution (think file upload box). I've used this successfully for mouse events. The support (and syntax) varies among browsers (try searching for these method names for help here), but I've gotten mouse events to work before. Good luck. - Richard On 9/15/07, Mark <[EMAIL PROTECTED]> wrote: > > > Hi, > I have a very large and complex form, and I am using some autocomplete > components, and I need when user selects one item in the autocomplete > option list, focus automatically go to the next component, like > pressing the tab key. > > So, I am trying to simulate a tab key press on a component, with no > success. I mean, sending a tab key to a component, just like if > someone had pressed it. > > Using $item.keypress() or $item.keydown() there is no way to add the > needed keyCode=9 > > I had no luck using trigger('keydown',[{keyCode:9}]); either, I dont > know if I am sending right the second parameter, but seems that no > event is called at all. > > If anyone know how to this, please help, it is really needed to finish > this project. > > Thanks in advance, > > Bye > Mark > >