views:

386

answers:

1

So far i have this being called on keypress.

function chkenter()
{
  e = event.keyCode;

  if (e == 13)
  {
    event.keyCode = 9;
    return false;
  }
}

but even though i set the keycode to 9 it doesn't tab over to the next control. How can i accomplish this? I'm working in Asp Classic.

What I ultimately want is for the focus to move to the next element. The next element's id, however, is not determined completely because its id was set in a loop, but at this point it exists. How can i set focus to the next control is the question.

+2  A: 

It is an IE only script, so if you try to run it on firefox it wont work.

For it to work on IE, remove "return false;" from your code and dont forget to atach this function into "onkeydown" event.

Cleiton
That's correct. Thanks. I should have realized this. The onkeydown is right before on key press. Thanks!!
Eric