When tabbing, focus should be only within the project create area... currently user is able to tab accross the tree, navigation pane etc.,

Recommended Answers

All 4 Replies

Set the tabstop property to false for the controls which are not
supposed to work on tab key press.

That works, but you will still tab out of the form area.

You need a javascript function:

function setFocus(input, objEvent) {
  if(objEvent.keycode == 66) {
    input.form[(getIndex(input)+1) % input.form.length].focus();
  }

  function getIndex(input) {
    var index = -1, i = 0, found = false;
    while (i < input.form.length && index == -1)
    if (input.form[i] == input)index = i;
    else i++;
    return index;
  }
  return true;
}

'' on page you need this under every field and button:
onkeypress="setFocus(this, event)"

If the key pressed is the tab key, it will automatically jump to the next corresponding field in the form. It will always stay within the form!

thanks for ur concern n sending me the code,pls keep doing it.

happy to help. I am a full-time javascript programmer who spent his life learning microsoft technologies. Figures right?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.