P
Paul Thompson
How do I determine in JavaScript the name of the object that focus is on?
Lasse said:That would solve the problem, by moving the focus to an object that you
know the name of. I don't think that was what the original poster had in
mind, though
By "focus", I assume is meant an input element (like a text field).
There is no simple way of finding the element with focus. What you can
do is to have each input element trigger a script when it gets focus,
and have that script store the element in a global variable. That
way the global variable will point to whatever element has focus.
What is this needed for?
/L
Paul Thompson said:What is this for? I have found that using the tab key to shift from
one widget to another works generally. However, when I use focus() to
shift focus to a widget, the use of tab after that is not correct -
instead of tabbing from the last focus object, it tabs from the last
TAB event.
I can't figger out why. Have you ever seen this?
Because of this, I am writing an event handler to control tabs correctly.
If you are interested, I can show you a web form which does just what
I said.
Lasse said:So it doesn't follow the focus directly, but continues from where it
was last time you tabbed?
Nope, but I usually leave navigation to the user, so no fiddling with
focus.
It is rarely wise to try and emulate a browser feature in javascript. The
browser should be better at it than your code will ever be.
On the other hand, working around a bug is always "fun".
That would be great. And please say which browser exhibits the
problem, and exactly how to recreate it (yes, I'm lazy .
/L
Paul Thompson said:Use NN, preferably a recent version (6.2 or later; I use 7.1)
http://www.biostat.wustl.edu/~consult/demo/startup.html ....
However, if you hit <TAB>, you will be shifted back up the screen.
How can I get the <TAB> key synchronized with the FOCUS() ?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.