2017-07-03 102 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

相關問題