Simulating tab event.

Simulating tab event.

Hi all.


I'm developing a web app that will be used by people used to using a green-screen. As such, they will probably be going through some system shock.

On their old system, everyone is used to hitting enter to go down to the next input. On web forms this submits the form. I'm looking for a way to catch the enter key and instead act like a tab.

Using the keypress event, I've canceled the form activation for all inputs but the submit button. Next, I want to trigger a keypress event with the tab key. I've seen samples online that do this by either using the tabindex or keeping track of a list of items on the page and changing the focus, but is there a way to do this in jquery at all?

This is an internal project, so it's safe to assume that the only users will be IE6 users.

I want to just do..

elem.trigger("keypress", e)

where e is what I received from the keypress event (that contained the enter key) and replace e.keyCode with the tab keycode. But no luck.

Any help on this?

Thanks in advance