2017-07-03 101 views
0

我正在使用ASP.NET向导控件来显示多步骤过程。我必须使用NVDA屏幕阅读器和所有浏览器访问表格。在NVDA正在读取顶部屏幕使用带有NVDA屏幕阅读器的向导控件的多步asp.net webform中的焦点问题

时,表单可以在Chrome中访问。这是标题

到底部的顺序。但是,当在Firefox + NVDA中检查相同的表单时,重点有时会移到中间,有时移到页脚。我的要求是屏幕阅读器应该始终从

读取这是所有向导步骤中的标题

。请,我需要你的帮助来解决这个问题。我的代码如下:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WizardRadioButtonListDemo.Default" %> 

<!DOCTYPE html> 

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
    <title>Accessibile Form</title>  
</head> 
<body> 
    <form id="form1" runat="server"> 
     <div> 
      <asp:Wizard ID="Wizard1" runat="server" DisplaySideBar="false"> 
       <HeaderTemplate> 
        <h1>This is header</h1> 
       </HeaderTemplate> 
       <WizardSteps>     
        <asp:WizardStep ID="WizardStep1" runat="server" Title="Step 1"> 
         <fieldset id="Fieldset1" runat="server"> 
          <legend id="Legend1" runat="server">Type</legend> 
          <asp:RadioButtonList ID="rdoServiceType" RepeatLayout="Flow" runat="server"> 
           <asp:ListItem Text="Gold" Value="0">Gold</asp:ListItem> 
           <asp:ListItem Text="Siver" Value="1">Silver</asp:ListItem> 
           <asp:ListItem Text="Premium" Value="2">Premium</asp:ListItem> 
          </asp:RadioButtonList> 
         </fieldset> 
        </asp:WizardStep> 
        <asp:WizardStep> 
         <asp:FileUpload ID="FileUpload1" runat="server" /> 
         <asp:Button ID="btnFileUpload" runat="server" Text="Upload" /> 
        </asp:WizardStep> 
        <asp:WizardStep ID="WizardStep2" runat="server" Title="Step 2"> 
         <fieldset id="Fieldset2" runat="server"> 
          <legend id="Legend2" runat="server">User</legend> 
          <asp:Label ID="lblFirstName" runat="server" Text="First Name" AssociatedControlID="txtFirstName"></asp:Label> 
          <asp:TextBox ID="txtFirstName" runat="server"></asp:TextBox> 
          <asp:Label ID="lblLastName" runat="server" Text="Last Name" AssociatedControlID="txtLastName"></asp:Label> 
          <asp:TextBox ID="txtLastName" runat="server"></asp:TextBox> 
         </fieldset> 
        </asp:WizardStep> 
       </WizardSteps> 
      </asp:Wizard> 
     </div> 
    </form> 
     <p>&copy; 2017 <a href="http://www.test.com" target="_blank">Test LLC.</a>. All rights reserved. Powered by <a href="http://www.test.com" target="_blank">Test</a></p> 

</body> 
</html> 

回答

0

好的,所以继承人我认为这个问题。所以你希望用户通过tab来读取h1。一种解决方案是将标签索引0添加到标题中。

为什么?

因为默认的html,唯一的tabbable元素是链​​接,按钮,&输入。 H1和p标签不这样做。但他们可以,如果你给他们的0制表指数...

所以补充一点:

 <HeaderTemplate tabindex="0"> 
      <h1>This is header</h1> 
     </HeaderTemplate> 

我可能已经理解你的问题是错误的。如果情况并非如此,您可以随时在您想要的部分中添加正值的Tab-index到表单中。

如:tab-index="1"

...等,并持续上涨。

+0

我试着在h1标签中使用tabindex,因为HeaderTemplate不支持tabindex属性,但它不适用于我。它在没有tabindex的Chrome中运行良好,但在Firefox屏幕阅读器(NVDA)中,在移动到步骤时强制关注其他一些元素。 – Simant

相关问题