Where is my focus?

R

R

Folks,
I am working on an intranet based application - end users requirement
is firefox 3 and I am finding a problem whereby as I tab from one
input form field to the next, focus is not always kept. Take the
following HTML code as an example:

<td class="fieldLabelRequired">Firstname</td>
<td><input name="employeeFirstname" type="text"
class="input200" id="employeeFirstname" tabindex="101"
maxlength="20"></td>
<td class="fieldLabelRequired">Lastname</td>
<td><input name="employeeLastname" type="text"
class="input200" id="employeeLastname" tabindex="102" maxlength="20"></
td>

When I tab from the input box known as employeeFirstname, the cursor
and focus is still within firefox but not visable (typing doesn't show
it up anywhere, nor do I get any errors). If I tab again, I find the
focus and blinking cursor in the box marked employeeLastname.

I've had this problem before (firefox 2.x and IE 6 & 7) but never
managed to successfully resolve it - I don't want to create a js
solution to manage the focus as users might want to navigate in
methods that I have not considered - however I would like focus to
follow a set path when the user moves using the tab key.

As a potential solution I thought I could have a script that would
write its current focus location (using getElementID or something and
update window.status) and thus give me an insight as to what is
happening and thus, hopefully, lead to a solution.

Can anyone tell me how I might do this? I have a fair idea on how to
read the x/y co-ordinates but thats not what I want - If the cursor
happens to be elsewhere in the form for some reason, I'd like to know
that its sitting in an address field for example.


Any ideas/suggestions? I'd be most grateful.

Thanks!
 
R

Richard Cornford

Folks,
I am working on an intranet based application - end users
requirement is firefox 3 and I am finding a problem whereby
as I tab from one input form field to the next, focus is not
always kept. Take the following HTML code as an example:

<td class="fieldLabelRequired">Firstname</td>
<td><input name="employeeFirstname" type="text"
class="input200" id="employeeFirstname" tabindex="101"
maxlength="20"></td>
<td class="fieldLabelRequired">Lastname</td>
<td><input name="employeeLastname" type="text"
class="input200" id="employeeLastname" tabindex="102"
maxlength="20"></
td>

When I tab from the input box known as employeeFirstname,
the cursor and focus is still within firefox but not visable
(typing doesn't show it up anywhere, nor do I get any errors).
If I tab again, I find the focus and blinking cursor in the
box marked employeeLastname.
Any ideas/suggestions? I'd be most grateful.

Your example (wrapped in the minimum mark-up necessary to make it into
a valid HTML page, and viewed in Friefox 3.5) does not exhibit the
symptoms described. If a (correctable/modifiable) cause and effect
relationship underlies your issue it cannot be identified from an
"example" that is not an example of the issue (beyond determining that
this mark-up is not that cause).

Richard.
 
R

R

Your example (wrapped in the minimum mark-up necessary to make it into
a valid HTML page, and viewed in Friefox 3.5) does not exhibit the
symptoms described. If a (correctable/modifiable) cause and effect
relationship underlies your issue it cannot be identified from an
"example" that is not an example of the issue (beyond determining that
this mark-up is not that cause).

Richard.

Thanks... the html is large - - several applications "input screens"
are hidden from the user and displayed when they click a menu... I
thought it would create a head ache for the reader if I were to upload
it - especially since it contains various client javascripts and
server based php output. I use the javascript console within firefox
3.5 and also have examined my server side error logs and have zero
errors with the css, javascript and php.

Thus - please ignore the reason behind my question...

Can you tell or direct me how I can read the focused position (id tag)
of where my cursor is?

Thanks...
 
R

R

I resolved the issue I think - I have several input screens - each
"hidden" and only the active input screen is displayed. When
designing the screens, I had tabindexes that were numerically
sequential - I have since discovered this is not required. Each input
display starts with a tabindex of 1 - I had incorrectly believed that
you could only have one tabindex of 1 in a single HTML file, and I am
guessing that somehow, the larger the number of tabindexse, things get
a bit mixed up.

Anyway - so far so good - I have one HTML file, each input screen
starts with a tabindex of 1 and the tabbing works exactly like the way
I'd expect.
 

Ask a Question

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.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top