PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > alt.www.webmaster > initial focus question
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
initial focus question

Réponse
 
LinkBack Outils de la discussion
Vieux 02/01/2008, 13h00   #1
ol'softy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut initial focus question

I'm using "tabindex=1" to flag the input field that needs to have
initial focus when a page comes up, but it doesn't receive focus until
the TAB key is hit.

Is there a way to have the field receive focus when the page is
displayed WITHOUT the user needing to hit the TAB key and WITHOUT
using any client-side scripting?

Perhaps some <form> attribute or something else I've missed? TIA.

--
contact via http://www.ren-prod-inc.com/hug_soft
  Réponse avec citation
Vieux 02/01/2008, 18h15   #2
Mark Goodge
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: initial focus question

On Wed, 02 Jan 2008 06:00:46 -0700, ol'softy put finger to keyboard
and typed:

>I'm using "tabindex=1" to flag the input field that needs to have
>initial focus when a page comes up, but it doesn't receive focus until
>the TAB key is hit.
>
>Is there a way to have the field receive focus when the page is
>displayed WITHOUT the user needing to hit the TAB key and WITHOUT
>using any client-side scripting?


No; it would need client-side scripting to change the focus after the
page has rendered (which is what you're wanting to happen). You can't
change it with any HTML tag, because the focus is (like scrolling and
resizing, etc) a function of the browser's operation rather than a
property of the page it is rendering.

Mark
--
http://www.BritishSurnames.co.uk - What does your surname say about you?
"A singing bird in an open cage who will only fly, only fly for freedom"
  Réponse avec citation
Vieux 03/01/2008, 13h09   #3
KarlCore
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: initial focus question

On Jan 2, 8:00 am, ol'softy <contact_info@sig_line.clickit> wrote:
> I'm using "tabindex=1" to flag the input field that needs to have
> initial focus when a page comes up, but it doesn't receive focus until
> the TAB key is hit.
>
> Is there a way to have the field receive focus when the page is
> displayed WITHOUT the user needing to hit the TAB key and WITHOUT
> using any client-side scripting?
>
> Perhaps some <form> attribute or something else I've missed? TIA.


Yes, this is possible. However, doing so isn't recommended.
Artificially setting focus on this will result in the page being read
from that point on (skipping everything before it) for screen reader
users.

Karl
  Réponse avec citation
Vieux 03/01/2008, 15h56   #4
ol'softy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: initial focus question

KarlCore <karl@karlcore.com> wrote:

>On Jan 2, 8:00 am, ol'softy <contact_info@sig_line.clickit> wrote:
>> I'm using "tabindex=1" to flag the input field that needs to have
>> initial focus when a page comes up, but it doesn't receive focus until
>> the TAB key is hit.
>>
>> Is there a way to have the field receive focus when the page is
>> displayed WITHOUT the user needing to hit the TAB key and WITHOUT
>> using any client-side scripting?
>>
>> Perhaps some <form> attribute or something else I've missed? TIA.

>
>Yes, this is possible. However, doing so isn't recommended.
>Artificially setting focus on this will result in the page being read
>from that point on (skipping everything before it) for screen reader
>users.


I concede that it isn't a good thing to do across the board, but I'm
talking about a login page which the user has arrived at by clicking a
link. I consider it kinda rude to make him click on the login
identity field and would prefer that he could just begin typing the
relevant information there.

You say it's possible, how?

I've learned that setting tabindex=1 for the first field also requires
(at least in Firefox) that you set tabindex for all the other fields
in the form, otherwise tabbing causes some previous link to receive
focus. I haven't yet dug into it fully, hoping some clues from folks
who've messed with this aspect alrady might save some time.

--
contact via http://www.ren-prod-inc.com/hug_soft
  Réponse avec citation
Vieux 03/01/2008, 16h02   #5
ol'softy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: initial focus question

Mark Goodge <usenet@listmail.good-stuff.co.uk> wrote:

>On Wed, 02 Jan 2008 06:00:46 -0700, ol'softy put finger to keyboard
>and typed:
>
>>I'm using "tabindex=1" to flag the input field that needs to have
>>initial focus when a page comes up, but it doesn't receive focus until
>>the TAB key is hit.
>>
>>Is there a way to have the field receive focus when the page is
>>displayed WITHOUT the user needing to hit the TAB key and WITHOUT
>>using any client-side scripting?

>
>No; it would need client-side scripting to change the focus after the
>page has rendered (which is what you're wanting to happen).


No, that's isn't what I'm wanting to happen. I'm wanting focus to
arrive at the first input field as a result of the page's rendering.
I've used any number of sites that implement client-side scripting to
move the cursor on me while I'm busily typing input, and I don't like
that at all.

> You can't
>change it with any HTML tag,


I could accept that, if I didn't already know that taborder can be
specified via html tags... but I do, so I don't.

> because the focus is (like scrolling and
>resizing, etc) a function of the browser's operation rather than a
>property of the page it is rendering.


Oh, I see, and no doubt the tabindex setting supported by html that
supports focus-change is somehow a property of the page's rendering
which is magically different from initial focus. Got it, thanks.

--
contact via http://www.ren-prod-inc.com/hug_soft
  Réponse avec citation
Vieux 03/01/2008, 18h32   #6
Mark Goodge
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: initial focus question

On Thu, 03 Jan 2008 09:02:39 -0700, ol'softy put finger to keyboard
and typed:

>Mark Goodge <usenet@listmail.good-stuff.co.uk> wrote:
>
>>On Wed, 02 Jan 2008 06:00:46 -0700, ol'softy put finger to keyboard
>>and typed:
>>
>>>I'm using "tabindex=1" to flag the input field that needs to have
>>>initial focus when a page comes up, but it doesn't receive focus until
>>>the TAB key is hit.
>>>
>>>Is there a way to have the field receive focus when the page is
>>>displayed WITHOUT the user needing to hit the TAB key and WITHOUT
>>>using any client-side scripting?

>>
>>No; it would need client-side scripting to change the focus after the
>>page has rendered (which is what you're wanting to happen).

>
>No, that's isn't what I'm wanting to happen. I'm wanting focus to
>arrive at the first input field as a result of the page's rendering.


That is changing the focus. By default, a form has no focus. Anything
that gives any field focus is a change from the default.

>I've used any number of sites that implement client-side scripting to
>move the cursor on me while I'm busily typing input, and I don't like
>that at all.


Like, for example, Google? That uses client-side scripting to set the
focus, and it does it very well. There are, of course, plenty of
counter-examples, but these are almost all cases where setting the
focus is the wrong thing to do. For a good overview of when it's not a
good idea to set focus (and when it can be a good idea), have a look
at http://bokardo.com/archives/setting-initial-focus/

Incidentally, if it was possible to set focus without client side
scripting, don't you think that Google would be a likely candidate for
doing it that way?

>> You can't
>>change it with any HTML tag,

>
>I could accept that, if I didn't already know that taborder can be
>specified via html tags... but I do, so I don't.


If you disagree, feel free to keep looking for a solution. And, when
you find it, post it here to prove me wrong.

>> because the focus is (like scrolling and
>>resizing, etc) a function of the browser's operation rather than a
>>property of the page it is rendering.

>
>Oh, I see, and no doubt the tabindex setting supported by html that
>supports focus-change is somehow a property of the page's rendering
>which is magically different from initial focus. Got it, thanks.


Yes, it's different.

Setting the tabindex tells the browser how you want it to behave when
an action is carried out by the user. Setting the focus carries out an
action. The former can be achieved with HTML. The latter cannot.

Mark
--
http://www.MotorwayServices.info - read and share comments and opinons
"L'amore giunger, l'amore"
  Réponse avec citation
Vieux 04/01/2008, 09h44   #7
ol'softy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: initial focus question

Mark Goodge <usenet@listmail.good-stuff.co.uk> wrote:

>On Thu, 03 Jan 2008 09:02:39 -0700, ol'softy put finger to keyboard
>and typed:
>
>>Mark Goodge <usenet@listmail.good-stuff.co.uk> wrote:
>>
>>>On Wed, 02 Jan 2008 06:00:46 -0700, ol'softy put finger to keyboard
>>>and typed:
>>>
>>>>I'm using "tabindex=1" to flag the input field that needs to have
>>>>initial focus when a page comes up, but it doesn't receive focus until
>>>>the TAB key is hit.
>>>>
>>>>Is there a way to have the field receive focus when the page is
>>>>displayed WITHOUT the user needing to hit the TAB key and WITHOUT
>>>>using any client-side scripting?
>>>
>>>No; it would need client-side scripting to change the focus after the
>>>page has rendered (which is what you're wanting to happen).

>>
>>No, that's isn't what I'm wanting to happen. I'm wanting focus to
>>arrive at the first input field as a result of the page's rendering.

>
>That is changing the focus. By default, a form has no focus. Anything
>that gives any field focus is a change from the default.


The concept of focus does not even apply unless the browser is the
active application. When it becomes the active application, it will
generally place the focus in some child window, assuming that it does
not want to ignore keyboard input. The usual case is for the
application to place initial focus on the first input-capable child
window in the taborder. But maybe I'm getting off into oranges here
while you're talking about apples. Focus is an abstract concept from
the go, since there is one keyboard (usually) and there are no windows
whatsoever unless the application paints some; from there it becomes a
matter of what the folks who write the application (browser in this
case) choose to do.

>>I've used any number of sites that implement client-side scripting to
>>move the cursor on me while I'm busily typing input, and I don't like
>>that at all.

>
>Like, for example, Google? That uses client-side scripting to set the
>focus, and it does it very well. There are, of course, plenty of
>counter-examples, but these are almost all cases where setting the
>focus is the wrong thing to do. For a good overview of when it's not a
>good idea to set focus (and when it can be a good idea), have a look
>at http://bokardo.com/archives/setting-initial-focus/
>
>Incidentally, if it was possible to set focus without client side
>scripting, don't you think that Google would be a likely candidate for
>doing it that way?


If there isn't profit in it they won't change how they do things,
that's pretty much a given; of course profit can come from many things
including reduced maintenance costs. Given the way blogger acts, no,
I wouldn't consider google at all likely to change it. Unfortunate
but what should be is seldom aligned with what is.

>>> You can't
>>>change it with any HTML tag,

>>
>>I could accept that, if I didn't already know that taborder can be
>>specified via html tags... but I do, so I don't.

>
>If you disagree, feel free to keep looking for a solution. And, when
>you find it, post it here to prove me wrong.


If it annoys me sufficiently I will find a solution or create one. If
I find a solution and someone asks about it, I would probably post the
solution if I read their query. I have no interest in proving anyone
wrong, there's a whole world out there doing that automatically
whenever they need it.

>>> because the focus is (like scrolling and
>>>resizing, etc) a function of the browser's operation rather than a
>>>property of the page it is rendering.

>>
>>Oh, I see, and no doubt the tabindex setting supported by html that
>>supports focus-change is somehow a property of the page's rendering
>>which is magically different from initial focus. Got it, thanks.

>
>Yes, it's different.
>
>Setting the tabindex tells the browser how you want it to behave when
>an action is carried out by the user. Setting the focus carries out an
>action. The former can be achieved with HTML. The latter cannot.


The former and the latter could both be specified by html and then
carried out by the browser. Apparently html provides no means of
specifying which field should receive initial focus within the page,
though I have not yet examined all the possibilities to determine if
that is the case. So it goes, there are lots of deficiencies in html
as there are in every other language.

--
contact via http://www.ren-prod-inc.com/hug_soft
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 07h52.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,17515 seconds with 15 queries