[whatwg] [Web Forms 2.0] autofocus attribute

Grey Grey at WebMK.de
Fri Jan 27 22:37:24 PST 2006

Hello folks,

I just read a bit of the spec on w3.org and soon found a point to complain.
How nice that I can do so immediately.

"Authors should avoid setting the autofocus attribute on multiple enabled
elements in a document. If multiple elements with the autofocus attribute
set are inserted into a document, each one will be processed as described
above, as they are inserted. This means that during document load, for
example, the last focusable form control in document order with the
attribute set will end up with the focus."

That does not really make sense for me. Why in the world should anyone want
such behavior? If you want to change the focus on-the-fly there are propably
better ways to do that. I had asked the vednors to include the option "only
focus on first" but as you're right at the roots, I think I should comment
on that this way.

I would appreciate to not allow multiple auto-focus attributes used in one
document. This would just be ugly procession if applied. But there are also
questions gathering when thinking about that. I can see the use of autofocus
very well, good for searches on sites (google for example) and propably web
apps and the like. But what, for example, if we have a frameset running with
3 framed html pages, each using autofocus? The navigation could have a
site-search on top and the other two could also have essential/important
fields (or simply the only ones viable for editing). So it may be a good
idea to restrict the autofocus on "parts" of the sites. This would be;
identify an autofocus attribute with the element using it and some parent
(or grandparent) ID. So if you hover any parts inside this [grand]parent,
the focus should be on the child containing the autofocus attribute.

So wait - this is contradictory !? Well, the easiest senseful of handling
autofocus is in my opinion only one per page, period. But if this is going
to be widened and fulfilling a certain purpose, I think my other idea might
not be too wrong. At least text box/area focus should go well with it
(displaying the blinking cursor).

I would like to hear what you people think about

Nachricht wurde mit Web.MK - MailSystem 2.7.2 erstellt.
Freemail powered by

More information about the whatwg mailing list