[whatwg] [wf2] Default submit button determination and autofocus

Current WF2 defines a way to determinate the default submit button[1].
While it is quite useful it would be even more useful if you could
decide which is the default submit button in WF2 compliant UAs:

# woo_	who really programs like that though.. "well, the first button
# 	is ALWAYS going to be the button I want to have executed"
# woo_	they apparently never had "customers"

ASP.NET2 provides quite a useful way[2] to point to the default submit 
button and the button that should get autofocus.

Personally I think declaring them on the FORM element might make more 
sense. (Not that WF2 currently provides a way to set a default submit 
button.) That way 'autofocus' wouldn't be an attribute with the name of 
its value, but an attribute with an ID as value. On page load the first 
FORM element with an 'autofocus' attribute set would be selected and 
when someone clicks inside a FORM element with an 'autofocus' attribute 
set the form control with an ID attribute that has a value the attribute 
points to would get focus.

The other attribute could be called 'defaultsubmit' or so and would work 
on a per form basis.

I know this would require quite some changes to the specification but I 
think it is worth it and since the specification would get another call 
for comments...


[1]<http://whatwg.org/specs/web-forms/current-work/#enter-submit>
[2]<http://weblogs.asp.net/skoganti/archive/2004/11/01/250482.aspx>


-- 
  Anne van Kesteren
  <http://annevankesteren.nl/>

Received on Thursday, 7 April 2005 05:38:42 UTC