Tabbing between text inputs with other tags between them

T

Thierry Lam

I currently have the following html:

<label for="Name">Name:</label>
<input type="text" value="" name="name" id="name" />
<a href="name">*</a>
<br />
<label for="Email">Email:</label>
<input type="text" value="" name="email" id="email" />
<a href="email">*</a>

I want to be able to tab from the name to email field with one key
tab. Right now, it's going through the first hyperlink before moving
to the email section. Are there some attributes that I can set to tab
straight to email from name? I can't remove the hyperlink since there
are js functionalities associated with it.
 
J

Jonathan N. Little

Thierry said:
I currently have the following html:

<label for="Name">Name:</label>
<input type="text" value="" name="name" id="name" />
<a href="name">*</a>
<br />
<label for="Email">Email:</label>
<input type="text" value="" name="email" id="email" />
<a href="email">*</a>

I want to be able to tab from the name to email field with one key
tab. Right now, it's going through the first hyperlink before moving
to the email section. Are there some attributes that I can set to tab
straight to email from name? I can't remove the hyperlink since there
are js functionalities associated with it.

http://www.w3.org/TR/html4/interact/forms.html#adef-tabindex
 
E

Eric Bednarz

Thierry Lam said:
<input type="text" value="" name="name" id="name" />
<a href="name">*</a>
<br />
<label for="Email">Email:</label>
<input type="text" value="" name="email" id="email" />
[…]

Are there some attributes that I can set to tab
straight to email from name? I can't remove the hyperlink since there
are js functionalities associated with it.

What functionalities, and what happens to that link without script?
Sounds like you want to solve the wrong problem. You can script any
element type, (fake) hyperlinks are usually chosen to get the behaviour
you are trying to get rid of.
 
H

Harlan Messinger

Thierry said:
I currently have the following html:

<label for="Name">Name:</label>
<input type="text" value="" name="name" id="name" />
<a href="name">*</a>
<br />
<label for="Email">Email:</label>
<input type="text" value="" name="email" id="email" />
<a href="email">*</a>

I want to be able to tab from the name to email field with one key
tab. Right now, it's going through the first hyperlink before moving
to the email section. Are there some attributes that I can set to tab
straight to email from name? I can't remove the hyperlink since there
are js functionalities associated with it.

What you're saying is that you're providing the links for users to use
at the appropriate locations within the form, but then you only want
mouse users to be able to use them. I recommend that you leave it as is
and let users tab through the links they don't need.
 
N

Neredbojias

What you're saying is that you're providing the links for users to
use at the appropriate locations within the form, but then you only
want mouse users to be able to use them. I recommend that you leave
it as is and let users tab through the links they don't need.


My first thought to this was "Hey, good point!" but then I realized
that with tabindex you could simply set the order-of-priority which you
want.
 
A

Adrienne Boswell

Gazing into my crystal ball I observed Neredbojias
My first thought to this was "Hey, good point!" but then I realized
that with tabindex you could simply set the order-of-priority which you
want.

And who is to say that I as a user want to use _your_ tab order? I hate
that. I'm happily tabbing, and typing, and then I realize I've typed the
wrong thing into the wrong field, because I _assumed_ it should be the
next thing on the form, but, no, it's number 5 or something.

Not to mention a maintenance nightmare.
 
J

Jukka K. Korpela

Thierry said:
I currently have the following html:

The URL would probably have revealed your real problem, and you would now
have a real solution to it...
<label for="Name">Name:</label>
<input type="text" value="" name="name" id="name" />
<a href="name">*</a>

A very odd link. And a strange <input> element, as it has no size="..."
attribute, so the visible width will be set by browser defaults and will be
too small for most people's names.
I want to be able to tab from the name to email field with one key
tab.

Remove the odd link then.
I can't remove the hyperlink since there
are js functionalities associated with it.

Yes you can and should. But you cannot get help with doing that unless you
show the real problem, i.e. the situation that made you include the odd
link.

When scripting is disabled, the element <a href="name">*</a> will act as
what it is, as a link to resource "name" relative to the base URL of the
document (_not_ as a link to the element with id="name" in the current
document - href="#name" would refer to it).
 
N

Neredbojias

Gazing into my crystal ball I observed Neredbojias


And who is to say that I as a user want to use _your_ tab order? I
hate that. I'm happily tabbing, and typing, and then I realize I've
typed the wrong thing into the wrong field, because I _assumed_ it
should be the next thing on the form, but, no, it's number 5 or
something.


Okay, I see your point. Not that the hypothetical wishes of the
general user are always sacrosanct to page-creation, but I do think the
usual things should pretty much "work normally".
Not to mention a maintenance nightmare.

Well, I live on Elm street so...
 

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,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top