W3C home > Mailing lists > Public > wai-xtech@w3.org > February 2007

re: Example of using required, invalid and alert

From: Becky Gibson <Becky_Gibson@notesdev.ibm.com>
Date: Thu, 22 Feb 2007 11:28:03 -0500
To: <wai-xtech@w3.org>
Message-ID: <OF88E342BA.0B924EB7-ON8525728A.00597833-8525728A.005A793E@LocalDomain>
I have updated my examples a bit and gotten the questions  answered. 

>Do we expect that there can be more than one state - both required and 
>invalid?  Should I remove the required field when I set the invalid role? 

Since required and invalid are properties, both can be set on the same 

I also updated the example  to catch the onblur event when a field is 
losing focus and forcing focus back to that field when it is invalid. This 
can be quite annoying so I'm looking for feedback on how folks feel about 

I've added an example where I monitor the onkeydown event and catch the 
tab key and enter key and check for errors.  When the tab key is pressed 
and there is an error, I make the error message visible and force focus 
back into the field.  If the user presses tab a second time, I allow focus 
to move to the next control. The error message is still displayed but at 
least the user is not "trapped" in the field until the error is fixed. 
Does this seem like a worthwhile convention to encourage? 

I've added a bit more text for each of the three examples to explain the 
behavior of each.

This is an XHTML file with a content-type of application/xhtml+xml so it 
can only be opened properly  in Firefox or Opera, although I did not test 
in Opera.

Becky Gibson
Web Accessibility Architect
IBM Emerging Internet Technologies
5 Technology Park Drive
Westford, MA 01886
Voice: 978 399-6101; t/l 333-6101
Email: gibsonb@us.ibm.com

Received on Thursday, 22 February 2007 16:28:26 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:51:32 UTC