Changing form to include a submit button for WCAG

℡╲_俬逩灬. 提交于 2019-12-11 03:59:32

问题


I currently have a form like so:

<form action="#">
    <select {if $isPostRequest}disabled="disabled" {/if}size="1" name="locale" 
onchange="location.href={if $languageToggleNoUser}'{$currentUrl|escape}{if strstr($currentUrl, '?')}&amp;{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>

It currently causes a WCAG 2.0 error, as all forms need a submit button.

I'm wondering how I could change this code to include a submit button. The code for the onchange option is quite convoluted, and I don't understand it.

Thanks.


回答1:


WCAG 2.0 does not require to have a submit button. What you link to is a technique, which is informative (not normative), and it’s only one of possibly many ways to achieve the guideline 3.2.2.

So it can be conforming to have no submit button, for example when

the user has been advised of the behavior before using the component

Related technique: G13: Describing what will happen before a change to a form control that causes a change of context to occur is made



来源:https://stackoverflow.com/questions/21819437/changing-form-to-include-a-submit-button-for-wcag

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!