Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to keep the focus in one input field

3 views
Skip to first unread message

Chris Werner

unread,
Aug 27, 2007, 2:51:57 AM8/27/07
to
Hi all,

I have a web app using html datawindows. Some special
kind of the front end dialogs is a browser screen with exact
one input field. The user has a scanner on a keyboard wedge
to scan barcodes. The scanner is setup to send a tab
character on the end of the input. In contrast to submit the
form and request a new url there is a httpRequest sent to
the server. All this works fine except that the focus leaves
the input field which is very uncomfortable for the user.
I've already tried calling some code in the onBlur() event
of the input field and this seems to work in some sense
(within the page the input field seems to hold the focus).

But the cursor jumps out of the whole page over to the
navigation toolbars url input field of the browser. Is there
any way to prevent the cursor to leave the web page?

TIA

Chris Werner
f+s software gmbh


Jim Egan

unread,
Aug 28, 2007, 1:37:11 AM8/28/07
to
"Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote...

You could create a dummy control on the page that has an tabindex value assigned to it (one
right after the input field). I think the onBlur would work then.

Alternatively, you could add an event to the input field to catch the tab character and do
something else beside act on the tab. Normally you would use the onKeyUp event. But since
you have input coming from a device that might not work. Try using the onChange event
instead.
--
Jim Egan [TeamSybase]

Message has been deleted

Jim Egan

unread,
Aug 30, 2007, 10:46:18 AM8/30/07
to
"Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote...
> Hi Jim,
>
> thank you very much, excellent suggestions! It works now
> having a dummy control on the page.

Good deal. I have found that the dummy control is a solution to a lot of things. I have
used it in a DataWindow quite a few times. I just have to make sure it is visible in the
painter or the next developer won't realize it is there.
--
Jim Egan [TeamSybase]

Chris Werner

unread,
Aug 30, 2007, 10:55:29 AM8/30/07
to
> I just have to make sure it is visible in the
> painter or the next developer won't realize it is there.

That may depend on who the next developer is: If he is
minded like you concerning the dummy control he should
realize it is already there. Otherwise he shouldn't see it
because he may delete it. ;-)

Chris Werner
f+s software gmbh

"Jim Egan" <eganjp...@compuserve.com> schrieb im Newsbeitrag
news:46d6d83a$2@forums-1-dub...

0 new messages