ASP.Net Cannot tab through all radio buttons when

2019-08-01 05:03发布

问题:

I'm trying to implement accessibility (keyboard only) ability on my site, but I'm having problems with Radio Button lists. When using radiobuttonlists, when initially, none of the radio buttons is selected, I am able to tab through every single value and select one upon hitting "enter". However, after a value is selected, I can only tab to the selected values, which presents a problem if I want to change the selected value.

From what I understand, radio buttons are grouped at the container controller level, thus when it is considered a group, only one can be selected at a time.

Any ideas on how to fix this issue?

回答1:

I believe you're correct about the RadioButtonList being one control (and therefore tabbing doesn't work). An alternative could be to create individual radio buttons and use the GroupName property to assign them all into one group. This should let you tab between them and still ensure they work in sync with each other.



回答2:

Actually, this is not an issue at all. If a value is not selected, the browser will go through each value within the group. Once a value is selected, the browser will only jump to the chosen value within that group. Thus to change values within the group, the user is to use the keyboard arrows.