[whatwg] LABEL and radio/checkbox onclick

Olav Junker Kj?r wrote:
> 
>>>   <p>The first submit button in a form should be the default button.
>>>   If the platform supports submitting a form implicitly (for example,
>>>   on some platforms hitting the "enter" key while a text field is
>>>   focussed implicitly submits the form), then when doing so the first
>>>   submit button should be the one used to initiate form submission
>>>   (and it will therefore be <a href="#successful">successful</a>).</p>
>>
>  > how is this supportable in IE6 with HTC's?
> 
> Probably by capturing key down events on text fields, and in the case of 
> an enter:
> 1) identify the default button (first submit button in document order, 
> which either has a form-attribute pointing to the form which owns the 
> text field, or has no form-attribute and is a descendant of the form)
> 2) inserting name and value from the default button into the data set.

Why not just fire click() for the submit button? I do this in my own 
scripts that fix the stupid MSIE behavior. Sure, the server cannot 
know if the user pressed ENTER or used mouse button but does it 
really matter?

-- 
Mikko

Received on Friday, 20 August 2004 01:27:44 UTC