辅助功能在javascript表单验证 [英] Accessibility in javascript form validation

查看:196
本文介绍了辅助功能在javascript表单验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是盲人的社会,我想ADRESS的一个重要问题。我怎么会告诉盲人访问者的用户名取?

This is an important issue for the blind community which I'm trying to adress. How would I tell blind visitors that the username is taken?

我目前的设置并不重要,但对实例的情况下,我目前得到一个jQuery实现,检查用户输入与PHP脚本在阿贾克斯,它返回一个JSON,然后我在一个错误字段中显示在屏幕上。非常基本的,并且超出了我的问题的范围,因为它完美地工作。

My current set-up is not important but for examples case, I've currently got a Jquery implementation that checks the user input against a php script over ajax, which returns a json which I then display on screen in an error field. Very basic, and beyond the scope of my issue as it is working perfectly.

但是,如果我瞎了,我也不会注意到用户名蝙蝠侠已经采取或不能包含空格,而且我的密码需要至少7个字符。

But if I'm blind, I won't notice that the username Batman is already taken or can't contain spaces, and that my password requires at least 7 characters.

另外,在提交表单时没有Javascript成为它的笨重的,但它的工作原理的错误中列出的错误登陆页面上。一个更好的更动态的解决方案,并询问服务将是最佳的。

Alternatively, the errors are listed on the error landing page after the form is submitted without javascript- it's chunky but it works. A better more dynamic solution and suport would be optimal.

推荐答案

由于屏幕阅读器的用户,我通常只需填写整个表单,提交它,如果它不工作,我再找找错误文本。为了提交整个表单之前通知有关无效数据盲人用户,看看咏叹调 - 活=自信可选场景下面的测试页面,D节上。 http://www.accessibleculture.org/articles/2011/02/aria-警报/ 从所有的测试用例D节就是火狐18.0.1下工作对我来说与大白鲨13.0唯一的测试。出于某种原因警报选项不起作用。您可以使用主见选项来通知用户的东西是错误的。

As a screen reader user I usually just fill out the entire form, submit it, and if it doesn't work I then look for error text. In order to notify a blind user about invalid data before the entire form is submitted take a look at the aria-live="assertive" option scene on the following test page, section d. http://www.accessibleculture.org/articles/2011/02/aria-alert/ Out of all the test cases section d is the only test that worked for me under firefox 18.0.1 with Jaws 13.0. For some reason the alert option doesn't work. You could use the assertive option to notify the user that something was wrong.

这篇关于辅助功能在javascript表单验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆