验证输入字段.易用性 [英] Validating input fields. Usability
问题描述
我正在做网站,这将帮助人们收集他们的 水表读数.目前,我正在填写输入表格以添加当前月份的读数.
I am doing site, which will help people to collect their water meters readings. At the moment I am doing input form for adding current month readings.
浏览器在用户输入数据时检查数据,而不是在表单发送之后(通过jquery)检查数据.例如,用户输入123
,然后按d
.他按下d
后,错误将出现在输入字段等附近.因此,该字段正在根据keyup
操作进行验证
Browser is checking data when user input it, not on/after form sending (via jquery). For example, user inputted 123
and pressed d
after. After he pressed d
error will appear near input field etc... So field is validating on keyup
action
我正在考虑添加测试,如果用户输入的值不小于上个月(或不是上个月,仅是最后输入的)值,则将通过测试.
I am thinking about adding test, that will be passed if user inputted value, that is not lesser then previous month (or not previous month, just last inputted) value.
因此,想象一下:上个月的仪表值为250.当前为255.输入字段为空.用户盯着打印.他按下2
(现在输入的值是2
).还记得在按键上正在测试价值吗? jQuery将开始测试并返回错误,因为2(字段中的当前值)< 250(上个月的仪表值).之后,他按下5
(现在输入的值是25
). 25< 250,因此jquery仍然会显示错误,即该值,用户输入无效.之后,他再次打印5
(现在输入的值是255
). 255不是<然后是250,则错误消息/阻止将消失.
So imagine: Last month meter value was 250. Current 255. Input field is blank. User staring print. He pressing 2
(inputted value is 2
now). Remember that value is being tested on key up? jQuery will start test and will return error because 2 (current value in field) < 250 (last month meter value). After that he pressing 5
(inputted value is 25
now). 25 < 250, so jquery will still show error, that value, user inputting is invalid. After that he printing 5
again (now value inputted is 255
). 255 not < then 250, so error message/block will disappear.
问题是这样的:在此测试的键盘输入上显示错误是否正确(检查输入的值是否小于上个月的值)?我认为这并不正确,因为某些用户对PC机非常陌生,并且此消息会吓到他们或idk :))))
这还好吗,还是我应该找到一种仅在onblur
动作下对此进行测试的方法(从领域中移出焦点)?但是显示错误消息是否为时已晚(我的意思是c的可用性)?由于更好的可用性,我正在检查ppl输入数据时的输入(因此ppl知道他在输入阶段的错误,而不是在发送表单后知道).
So the question is such: is it correct to show error on keyup for this test (checking if inputted value is less then last month value)? I think it is not rly correct, because some users are very newb to pc's and this message can scare them or idk :)))
Is it okay or should I find a way to test this only on onblur
action (remove focus from field)? But will it be too late to show error message (I mean usability ofc)? I am checking inputs when ppl input their data because of better usability (so ppl know about his mistake on input stage, not after sending form).
也许还有其他建议?
推荐答案
向键盘添加超时,这可能是同一问题的重复:
Add a timeout to the keyup, this is a possible duplicate of this same issue:
这篇关于验证输入字段.易用性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!