Hi All,
Is there any way to set the focus to a table row using javascript so that subsequent key press events can iterate through the table rows.Please help me to solve this.

Thanks

Hi All,
Is there any way to set the focus to a table row using javascript so that subsequent key press events can iterate through the table rows.Please help me to solve this.

Thanks

Only things that can accept focus can receive focus, which would be form objects like text boxes, radio buttons etc... and hyperlinks. You should be able to do it with the focus() function.

Hi All,
Is there any way to set the focus to a table row using javascript so that subsequent key press events can iterate through the table rows.Please help me to solve this.

Thanks

As nikesh.yadav already pointed, there are only two true conventional browsers that will handle focus as expected for elements other anchors and forms for certain. That is, IE and FX.

You can write a loop function that iterates through table elements that should receive focus and use a declaration like: tag[i].tabIndex = "auto"; to make them receive focus. This additionally prevents you from breaking the tab order on your document.

It will enable your client to tab through your table rows, cells and/or other desired elements the conventional way, (or browser specific), without having to explain that there are keys with added functionality and how to use them.

Regards.

This article has been dead for over six months. Start a new discussion instead.