【问题标题】:HTML Accessibility Error - Label text is empty?HTML 辅助功能错误 - 标签文本为空?
【发布时间】:2013-12-11 17:15:07
【问题描述】:

即使声明包含错误的行没有标签元素,我仍然会收到此错误?

3.3 Input Assistance: Help users avoid and correct mistakes.

Success Criteria 3.3.2 Labels or Instructions (A)

Check 188: Label text is empty.
Repair: Add text to the label element.
Error Line 75, Column 6:
<input class="subsubmit" type="reset" value="Reset" id="Reset">

代码是:

<section id="subscribeEmail">
            <!--This section allows the user the option to subscribe to my blogs if they don't have an RRS feed. It only asks for a name and email address before sending it to my email address 
            where I can then store their email and add them to my CC every time I sent out a new bog post.-->
                <h3>Never Miss a Post:</h3>
                <form class="subscribe" action="mailto:tm_mitchell@hotmail.co.uk" method="post">
                    <label for="sub-name">Enter Name: </label>
                        <input id="sub-name" title="name" class="sub" type="text" size="35" maxlength="40" placeholder="Full Name" required>        
                    <label for="sub-email">Enter Email: </label>    
                        <input id="sub-email" title="email" class="sub" type="text" size="35" maxlength="40" placeholder="Enter email to subscribe" required>   
                    <input class="subsubmit" type="reset" value="Reset" id="Reset">
                    <input class="subsubmit" type="submit" value="Send" id="Submit">
                </form>
            </section>

出了什么问题?

谢谢

【问题讨论】:

  • 您应该指定发出消息的软件以及行号是什么。

标签: html forms text label accessibility


【解决方案1】:

使用的可访问性测试工具有问题。它说您应该有一个重置按钮的标签,但是 WCAG 2.0 的 H44:Using label elements to associate text labels with form controls 条款明确表示标签用于重置按钮。

另一方面,重置按钮几乎总是不利于可访问性和正常使用。正如可用性专家 Jakob Nielsen writes 所说:“如果几乎所有重置按钮都被移除,Web 将是一个更快乐的地方。这个按钮几乎从不帮助用户,但经常伤害他们。”

【讨论】:

  • 也可以通过为元素指定标题来消除错误。例如:
猜你喜欢
  • 1970-01-01
  • 2022-11-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多