客户端验证控件的自动完成基本问题 [英] Autocomplete cuasing problems with client side validation controls

查看:63
本文介绍了客户端验证控件的自动完成基本问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用于输入用户地址的表单,所有字段都有一个必需的

验证与之关联的控件以及每个字段的错误信息

显示就在旁边。正常的行为是错误消息msg

没有显示单位使用点击提交按钮或用户输入数据和

将焦点移动到另一个控件所以田地变脏了。到目前为止

好​​。现在,当用户返回该控件并开始输入数据时,自动完成功能启动并向他们显示选项列表。如果

用户从自动填充列表中选择一个项目,或者将键完全相同的

文本作为列表中的项目,然后将焦点移离字段

错误消息不会消失。但是,在自动完成列表中没有找到新数据中的用户键,然后将焦点移开,然后将错误消息移除,然后将错误信息发送给消息。这种行为是不一致的,如果错误消息没有消失,那么当它应该消失时,它可能会让用户感到困惑或误导

他们可能认为该字段不是有效。注意:即使错误消息msg

仍然显示,即使它已经消失,因为该字段

有效,该页面有效且可以提交。


我不想关闭自动完成功能,因为填写地址是人们必须经常做的那些事情,而且很多时间可以是
使用此功能保存。如果我不得不一直输入我的

地址,我个人会很生气。但是,这个错误的问题不会消失,因为它应该也是令人烦恼和混乱的。


任何好的解决方案?

-
mo*******@nospam.com

I have a form for entering a user''s address and all fields have a required
validating control associated with them and the error msg for each field
displays right next to it. The normal behavior is that the error msg
doesn''t show unit the use hits the submit button or the user enters data and
moves the focus to another control so the field becomes dirty. So far so
good. Now when the user goes back to that control and starts to input data
the auto complete feature kicks in and shows them a list of options. If the
user selects an item from the autocomplete list or keys in the exact same
text as an item in the list and then moves the focus away from the field the
error msg does NOT go away. However, it the user keys in new data not found
in the autocomplete list and then moves the focus away then the error msg
DOES go away. This behavior is inconsistent and if the error msg does not
go away when it should then it can be confusing or misleading to the user
where they may think the field is not valid. NOTE: even if the error msg
remains showing even when it should have disappeared because the field is
valid, the page IS valid and can be submitted.

I don''t want to turn off autocomplete because filling out addresses is one
of those things that people have to do too often and a lot of time can be
save using this feature. I personally would be annoyed if I had to enter my
address in full all the time. However, the issue of this error msg not
disappearing when it should is also annoying and confusing.

Any good solutions?

--
mo*******@nospam.com

推荐答案

你必须抓住onblur,并重新验证输入。

- bruce(sqlwork.com)


" moondaddy" <莫******* @ nospam.com>在消息中写道

新闻:Ox ************** @ TK2MSFTNGP12.phx.gbl ...
You will have to catch the onblur, and revalidate the input.
-- bruce (sqlwork.com)

"moondaddy" <mo*******@nospam.com> wrote in message
news:Ox**************@TK2MSFTNGP12.phx.gbl...
我有一张表格输入用户的地址,所有字段都有一个与之关联的必要
验证控件,并且每个字段的错误信息显示在它旁边。正常的行为是错误信息没有显示单位使用点击提交按钮或用户输入数据
并将焦点移动到另一个控件,因此字段变脏。到目前为止很好。现在,当用户返回该控件并开始输入
数据时,自动完成功能将启动并向他们显示选项列表。如果
用户从自动完成列表中选择一个项目,或者键入与列表中项目完全相同的文本,然后将焦点从字段
移开,则错误消息不会消失远。但是,用户键入新数据而不是在自动完成列表中找到
,然后将焦点移开,然后错误信息
会消失。这种行为是不一致的,如果错误消息没有消失,那么它可能会让用户感到困惑或误导他们可能认为该字段无效。注意:即使错误信息仍然显示,即使它已经消失,因为该字段有效,该页面有效且可以提交。

我不是我想关闭自动完成功能,因为填写地址是人们必须经常做的事情之一,并且很多时间可以使用此功能进行保存。如果我不得不一直输入
我的地址,我个人会很生气。但是,这个错误的问题不会消失,当它应该也令人烦恼和混乱。

任何好的解决方案?

-
< a href =mailto:mo ******* @ nospam.com> mo ******* @ nospam.com
I have a form for entering a user''s address and all fields have a required
validating control associated with them and the error msg for each field
displays right next to it. The normal behavior is that the error msg
doesn''t show unit the use hits the submit button or the user enters data and moves the focus to another control so the field becomes dirty. So far so
good. Now when the user goes back to that control and starts to input data the auto complete feature kicks in and shows them a list of options. If the user selects an item from the autocomplete list or keys in the exact same
text as an item in the list and then moves the focus away from the field the error msg does NOT go away. However, it the user keys in new data not found in the autocomplete list and then moves the focus away then the error msg
DOES go away. This behavior is inconsistent and if the error msg does not
go away when it should then it can be confusing or misleading to the user
where they may think the field is not valid. NOTE: even if the error msg
remains showing even when it should have disappeared because the field is
valid, the page IS valid and can be submitted.

I don''t want to turn off autocomplete because filling out addresses is one
of those things that people have to do too often and a lot of time can be
save using this feature. I personally would be annoyed if I had to enter my address in full all the time. However, the issue of this error msg not
disappearing when it should is also annoying and confusing.

Any good solutions?

--
mo*******@nospam.com



谢谢布鲁斯。这对其他开发人员来说也是如此吗?我想b $ b会认为它发生了很多,如果我开始在

onblur事件中编写我自己的验证,那么我将失去使用验证的一些好处

首先控制,我也让自己更容易接受错误

和其他浏览器的问题。 MS,如果你正在听,你有没有

对此有进一步的评论?


再次感谢。


-
mo*******@nospam.com

布鲁斯巴克 <无*********** @ safeco.com>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...
Thanks Bruce. Does this happen to lots to other developers as well? I
would think it happens a lot and if I start writing my own validation in the
onblur event then I''m loosing some of the benefit of using the validation
controls in the first place, and I''m also leaving myself more open to bugs
and problems with other browsers. MS, if you are listening, do you have any
further comments on this?

Thanks again.

--
mo*******@nospam.com
"bruce barker" <no***********@safeco.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
你会必须抓住onblur,并重新验证输入。

- 布鲁斯(sqlwork.com)

moondaddy <莫******* @ nospam.com>在消息中写道
新闻:Ox ************** @ TK2MSFTNGP12.phx.gbl ...
You will have to catch the onblur, and revalidate the input.
-- bruce (sqlwork.com)

"moondaddy" <mo*******@nospam.com> wrote in message
news:Ox**************@TK2MSFTNGP12.phx.gbl...
我有一个输入用户的表格'的地址和所有字段都有一个
所需的验证控件,并且每个字段的错误信息显示在它旁边。正常的行为是错误信息没有显示单位使用命中提交按钮或用户输入数据而
I have a form for entering a user''s address and all fields have a required validating control associated with them and the error msg for each field
displays right next to it. The normal behavior is that the error msg
doesn''t show unit the use hits the submit button or the user enters data and
将焦点移动到另一个控件,因此字段变脏。到目前为止
这么好。现在,当用户返回该控件并开始输入
moves the focus to another control so the field becomes dirty. So far so good. Now when the user goes back to that control and starts to input


数据

时,自动完成功能将启动并向他们显示选项列表。如果
the auto complete feature kicks in and shows them a list of options. If


用户从自动完成列表中选择一个项目,或者键入与列表中项目完全相同的
相同文本,然后将焦点移离字段
user selects an item from the autocomplete list or keys in the exact same text as an item in the list and then moves the focus away from the field


错误消息不会消失。但是,用户键入新数据不
error msg does NOT go away. However, it the user keys in new data not


在自动完成列表中找到


found

然后将焦点移开然后错误
msg会消失。这种行为是不一致的,如果错误消息msg确实没有消失,那么它可能会让
用户感到困惑或误导他们可能认为该字段无效。注意:即使错误
msg仍然显示,因为字段
有效,它仍然会消失,页面有效且可以提交。

我不是我想关闭自动完成功能,因为填写地址是
人们必须经常做的事情之一,而且很多时间可以使用此功能保存
。如果我不得不
in the autocomplete list and then moves the focus away then the error msg DOES go away. This behavior is inconsistent and if the error msg does not go away when it should then it can be confusing or misleading to the user where they may think the field is not valid. NOTE: even if the error msg remains showing even when it should have disappeared because the field is valid, the page IS valid and can be submitted.

I don''t want to turn off autocomplete because filling out addresses is one of those things that people have to do too often and a lot of time can be save using this feature. I personally would be annoyed if I had to



一直输入我的


enter my

地址,我个人会很生气。但是,这个错误的问题不会消失,当它应该也令人烦恼和混乱。

任何好的解决方案?

-
< a href =mailto:mo ******* @ nospam.com> mo ******* @ nospam.com
address in full all the time. However, the issue of this error msg not
disappearing when it should is also annoying and confusing.

Any good solutions?

--
mo*******@nospam.com




谢谢布鲁斯。这对其他开发人员来说也是如此吗?我想b $ b会认为它发生了很多,如果我开始在

onblur事件中编写我自己的验证,那么我将失去使用验证的一些好处

首先控制,我也让自己更容易接受错误

和其他浏览器的问题。 MS,如果你正在听,你有没有

对此有进一步的评论?


再次感谢。


-
mo*******@nospam.com

布鲁斯巴克 <无*********** @ safeco.com>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...
Thanks Bruce. Does this happen to lots to other developers as well? I
would think it happens a lot and if I start writing my own validation in the
onblur event then I''m loosing some of the benefit of using the validation
controls in the first place, and I''m also leaving myself more open to bugs
and problems with other browsers. MS, if you are listening, do you have any
further comments on this?

Thanks again.

--
mo*******@nospam.com
"bruce barker" <no***********@safeco.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
你会必须抓住onblur,并重新验证输入。

- 布鲁斯(sqlwork.com)

moondaddy <莫******* @ nospam.com>在消息中写道
新闻:Ox ************** @ TK2MSFTNGP12.phx.gbl ...
You will have to catch the onblur, and revalidate the input.
-- bruce (sqlwork.com)

"moondaddy" <mo*******@nospam.com> wrote in message
news:Ox**************@TK2MSFTNGP12.phx.gbl...
我有一个输入用户的表格'的地址和所有字段都有一个
所需的验证控件,并且每个字段的错误信息显示在它旁边。正常的行为是错误信息没有显示单位使用命中提交按钮或用户输入数据而
I have a form for entering a user''s address and all fields have a required validating control associated with them and the error msg for each field
displays right next to it. The normal behavior is that the error msg
doesn''t show unit the use hits the submit button or the user enters data and
将焦点移动到另一个控件,因此字段变脏。到目前为止
这么好。现在,当用户返回该控件并开始输入
moves the focus to another control so the field becomes dirty. So far so good. Now when the user goes back to that control and starts to input


数据

时,自动完成功能将启动并向他们显示选项列表。如果
the auto complete feature kicks in and shows them a list of options. If


用户从自动完成列表中选择一个项目,或者键入与列表中项目完全相同的
相同文本,然后将焦点移离字段
user selects an item from the autocomplete list or keys in the exact same text as an item in the list and then moves the focus away from the field


错误消息不会消失。但是,用户键入新数据不
error msg does NOT go away. However, it the user keys in new data not


在自动完成列表中找到


found

然后将焦点移开然后错误
msg会消失。这种行为是不一致的,如果错误消息msg确实没有消失,那么它可能会让
用户感到困惑或误导他们可能认为该字段无效。注意:即使错误
msg仍然显示,因为字段
有效,它仍然会消失,页面有效且可以提交。

我不是我想关闭自动完成功能,因为填写地址是
人们必须经常做的事情之一,而且很多时间可以使用此功能保存
。如果我不得不
in the autocomplete list and then moves the focus away then the error msg DOES go away. This behavior is inconsistent and if the error msg does not go away when it should then it can be confusing or misleading to the user where they may think the field is not valid. NOTE: even if the error msg remains showing even when it should have disappeared because the field is valid, the page IS valid and can be submitted.

I don''t want to turn off autocomplete because filling out addresses is one of those things that people have to do too often and a lot of time can be save using this feature. I personally would be annoyed if I had to



一直输入我的


enter my

地址,我个人会很生气。但是,这个错误的问题不会消失,当它应该也令人烦恼和混乱。

任何好的解决方案?

-
< a href =mailto:mo ******* @ nospam.com> mo ******* @ nospam.com
address in full all the time. However, the issue of this error msg not
disappearing when it should is also annoying and confusing.

Any good solutions?

--
mo*******@nospam.com




这篇关于客户端验证控件的自动完成基本问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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