Home All Groups Group Topic Archive Search About

Re: accessibility and asp:button

Author
5 Jul 2005 8:21 PM
JV
This is for anyone who has tackled the accessibility issue on their web
site
(and if you haven't, I bet you will in future).

Apparently the asp:button control always renders as  '<input type="submit"
...' (a.k.a. submit button)  and this can have a big impact on your web
site's keyboard handling.  Default IE behavior when you have the keyboard
focus on an edit field is to find the first submit button and trigger a
click event on it  (NOTE: Submit buttons behave similarly to a default
button in a Windows GUI application -- often the "Ok" button -- so their
border is drawn darker to indicate that they are the default for that form.
Of course, blind people cannot detect that, but hey...).

Anyway, if you use multiple asp:button controls on your web form, the ENTER
key's behavior may surprise your users.  Did you put a LOGIN/LOGOUT button
on all of your pages?  Maybe ENTER logs them out instead of clicking the
SUBMIT button you expected it to click.

So, it's probably not a good idea to use the asp:button control more than
once on your form, and then only for the most obvious, sensible default
button.

Has anyone else run into this?

--JV

P.S.  Before you freak out, keep in mind this only applies when keyboard
focus is on an edit field.  If it is on a button or hyperlink, default
behavior is to click that button or hyperlink.

Author
6 Jul 2005 1:47 PM
Michael Baltic
The framework is supposed to detect if you have more than one button on your
form.  If you do, it removes the submit attribute from ALL of them.  You
would then have to manually attach the submit code to a button.

Alternately, you can have multiple forms on your html page that each have a
submit button.  Whichever form has the focus would catch the onsubmit code. 
This is not a trivial coding task....
--
Staff Consultant II
Enterprise Web Services
Cardinal Solutions Group

Future Business Model
Loan Origination Services
National City Mortgage


Show quoteHide quote
"JV" wrote:

>  This is for anyone who has tackled the accessibility issue on their web
> site
>  (and if you haven't, I bet you will in future).
>
>  Apparently the asp:button control always renders as  '<input type="submit"
>  ...' (a.k.a. submit button)  and this can have a big impact on your web
>  site's keyboard handling.  Default IE behavior when you have the keyboard
>  focus on an edit field is to find the first submit button and trigger a
>  click event on it  (NOTE: Submit buttons behave similarly to a default
>  button in a Windows GUI application -- often the "Ok" button -- so their
>  border is drawn darker to indicate that they are the default for that form.
>  Of course, blind people cannot detect that, but hey...).
>
>  Anyway, if you use multiple asp:button controls on your web form, the ENTER
>  key's behavior may surprise your users.  Did you put a LOGIN/LOGOUT button
>  on all of your pages?  Maybe ENTER logs them out instead of clicking the
>  SUBMIT button you expected it to click.
>
>  So, it's probably not a good idea to use the asp:button control more than
>  once on your form, and then only for the most obvious, sensible default
>  button.
>
>  Has anyone else run into this?
>
>  --JV
>
>  P.S.  Before you freak out, keep in mind this only applies when keyboard
>  focus is on an edit field.  If it is on a button or hyperlink, default
>  behavior is to click that button or hyperlink.
>
>
>
>
Author
6 Jul 2005 1:47 PM
Michael Baltic
Sorry, didnt mean to say that it remove the submit attribute from the button.
But that it removes the keypress event for the enter key to fire the button
click event.  You would need to capture the form's keypress event for the
enter key.
--
Staff Consultant II
Enterprise Web Services
Cardinal Solutions Group

Future Business Model
Loan Origination Services
National City Mortgage


Show quoteHide quote
"JV" wrote:

>  This is for anyone who has tackled the accessibility issue on their web
> site
>  (and if you haven't, I bet you will in future).
>
>  Apparently the asp:button control always renders as  '<input type="submit"
>  ...' (a.k.a. submit button)  and this can have a big impact on your web
>  site's keyboard handling.  Default IE behavior when you have the keyboard
>  focus on an edit field is to find the first submit button and trigger a
>  click event on it  (NOTE: Submit buttons behave similarly to a default
>  button in a Windows GUI application -- often the "Ok" button -- so their
>  border is drawn darker to indicate that they are the default for that form.
>  Of course, blind people cannot detect that, but hey...).
>
>  Anyway, if you use multiple asp:button controls on your web form, the ENTER
>  key's behavior may surprise your users.  Did you put a LOGIN/LOGOUT button
>  on all of your pages?  Maybe ENTER logs them out instead of clicking the
>  SUBMIT button you expected it to click.
>
>  So, it's probably not a good idea to use the asp:button control more than
>  once on your form, and then only for the most obvious, sensible default
>  button.
>
>  Has anyone else run into this?
>
>  --JV
>
>  P.S.  Before you freak out, keep in mind this only applies when keyboard
>  focus is on an edit field.  If it is on a button or hyperlink, default
>  behavior is to click that button or hyperlink.
>
>
>
>