0

我正在使用 ASP.NET 向导控件来显示多步骤过程。我必须让 NVDA 屏幕阅读器和所有浏览器都可以访问该表单。由于 NVDA 从顶部读取屏幕,因此可以在 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>
4

1 回答 1

0

好的,这就是我认为的问题。因此,您希望用户通过制表符阅读 h1。一种解决方案是在标题中添加一个 0 的选项卡索引。

为什么?

因为默认情况下 html,唯一的可选项卡元素是链接、按钮和输入。H1 和 p-tags 不这样做。但是如果你给他们一个 0 的标签索引,他们可以。

所以添加这个:

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

我可能把你的问题解释错了。如果不是这种情况,您始终可以在您希望它转到的部分中将正值的制表符索引添加到您的表单中。

如:tab-index="1"

...等,并继续上升。

于 2017-07-03T19:12:53.410 回答