我目前有一个像这样的表格:
<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 的多种可能方法之一。 .
因此,没有提交按钮可能是符合要求的,例如当
the user has been advised of the behavior before using the component
关于html - 更改表单以包含 WCAG 的提交按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21819437/