If there is a focusable element inside a div then the onkeypress works

Name: David MacDonald
Email: david100@sympatico.ca
Affiliation: working group member
Document: TD
Item Number: F42
Part of Item: Examples
Comment Type: technical
Summary of Issue: If there is a focusable element inside a div then the onkeypress works
Comment (Including rationale for any proposed change):
an example is http://www.ottawapolice.ca
there is a search form in the top left. The input tag is inside a div. The input gets focus... and when someone hits the enter key from there the containing div fires the go button and does the search. It technically fails because it is an onkeypress on a non focusable element... but it didn't seem to fail ... it accepted tab focus, showed up as a form, and responded to a keypress
<div id="ctl00_Header1_Panel1" onkeypress="javascript:return WebForm_FireDefaultButton(event, 'ctl00_Header1_ib_go')">
<input name="ctl00$Header1$queryText" type="text" value="search" id="ctl00_Header1_queryText" class="sf_searchText" onFocus="clearSearchBox(this)" />
                <input type="image" name="ctl00$Header1$ib_go" id="ctl00_Header1_ib_go" title="Go button for Search field" Text="Search" alt="Search" class="sf_searchSubmit" src="/App_Images/navigation/primary/go_en.png" style="border-width:0px;" />
            
</div>

Proposed Change:
Recommend, amend the language of example number 4.

In the body of the technique insert a line that says. 
"If there is a focusable element inside a div that has an onkeypress, such as an input, which is recognized by Assistive technology, then it would NOT be a failure because the containing DIV will respond to the focusable, recognized element.

Add the following example or something like it to SCR35:

<div id="ctl00_Header1_Panel1" onkeypress="javascript:return WebForm_FireDefaultButton(event, 'ctl00_Header1_ib_go')">
<input name="ctl00$Header1$queryText" type="text" value="search" id="ctl00_Header1_queryText" class="sf_searchText" onFocus="clearSearchBox(this)" />
 <input type="image" name="ctl00$Header1$ib_go" id="ctl00_Header1_ib_go" title="Go button for Search field" Text="Search" alt="Search" class="sf_searchSubmit" src="/App_Images/navigation/primary/go_en.png" style="border-width:0px;" />        
</div>

Received on Monday, 2 September 2013 01:23:08 UTC