【发布时间】:2014-02-17 01:50:54
【问题描述】:
我目前有这样的表格:
<form action="#">
<select {if $isPostRequest}disabled="disabled" {/if}size="1" name="locale"
onchange="location.href={if $languageToggleNoUser}'{$currentUrl|escape}{if strstr($currentUrl, '?')}&{else}?{/if}setLocale='+this.options[this.selectedIndex].value{else}('{url|escape:"javascript" page="user" op="setLocale" path="NEW_LOCALE" source=$smarty.server.REQUEST_URI}'.replace('NEW_LOCALE', this.options[this.selectedIndex].value)){/if}" class="selectMenu">{html_options options=$languageToggleLocales selected=$currentLocale}</select>
</form>
它当前会导致 WCAG 2.0 错误,如 all forms need a submit button。
我想知道如何更改此代码以包含提交按钮。 onchange 选项的代码比较复杂,看不懂。
谢谢。
【问题讨论】:
-
WCAG 2.0 不需要提交按钮。你链接到的是一种技术,它是信息性的(不是规范性的),它只是实现指南3.2.2 的可能众多方法之一
-
我明白了,感谢您的澄清,我应该关注成功标准而不是技术测试。此表单是语言的下拉列表,当单击它时,系统会加载具有不同翻译的单独文档。这没有通过3.2.2 On Input,对吗?谢谢。
-
它说“除非用户在使用组件之前被告知行为”——所以如果你描述会发生什么,它应该通过。相关技术:G13: Describing what will happen before a change to a form control that causes a change of context to occur is made.
-
太好了,谢谢。现在开始了解 WCAG。
标签: html accessibility wcag wcag2.0