我可以一次将验证器绑定到两个控件吗? [英] Can I tie a validator to two controls at once?

查看:48
本文介绍了我可以一次将验证器绑定到两个控件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我在表单上有两个下拉控件,代表一个月/年

组合。输入的日期必须在将来,所以我写了一个自定义

验证器来检查这个。麻烦的是,验证器只绑定了一个

控件(目前是月份下拉列表),这意味着验证

当另一个控件''时没有被触发''值变化。


当两个控件中的一个更改时,有没有办法让客户端验证代码触发? TIA


-

Alan Silver

(此行下方添加的任何内容都与我无关)

解决方案

这些验证控件为我开启了一个全新的世界:

http://www.peterblum.com/VAM/Home.aspx


你可以满足你的要求,还有更多。


-

Jay Douglas
http://www.jaydouglas.com

" Alan Silver" <人********* @ nospam.thanx>在消息中写道

新闻:jw ************** @ nospamthankyou.spam ...

你好,
<我在表单上有两个下拉控件,表示一个月/年的组合。输入的日期必须在将来,所以我写了一个自定义的
验证器来检查这个。麻烦的是,验证器仅与一个
控件(当前是月份下拉列表)相关联,这意味着当其他控件的值发生变化时,验证不会被触发。

是否有一种方法可以在两个控件中的任何一个更改时触发客户端验证代码? TIA

-
Alan Silver
(此行下面添加的任何内容都与我无关)



>这些验证控件为我打开了一个全新的世界:


http://www.peterblum.com/VAM/Home.aspx

您可以满足您的要求,还有更多。



谢谢,他们看起来非常好。


我从你的答案中假设我不想做的事情很容易做到在

ASP.NET?我想知道2.0中的更改是否带来了任何改进

到验证控件。


感谢您的回复


-

Alan Silver

(此行下面添加的任何内容都与我无关)


从我注意到的情况来看,2.0中的验证控件在功能方面没有取得很好的成果。有一些新的东西,如设置

专注于错误和其他一些项目。


-

Jay Douglas
http://www.jaydouglas.com

" ; Alan Silver <人********* @ nospam.thanx>在消息中写道

news:iw ************** @ nospamthankyou.spam ...

这些验证控件为我开辟了一个全新的世界:

http://www.peterblum.com/VAM/Home.aspx

您可以满足您的要求,以及更多。


谢谢,他们看起来非常好。

我从你的答案中假设我不想在ASP.NET中轻松完成我想做的事情?我想知道2.0中的变化是否对验证控件带来了任何改进。

感谢您的回复

-
Alan Silver
(此行下面添加的任何内容都与我无关)



Hello,

I have two dropdown controls on a form, representing a month/year
combination. The date entered must be in the future, so I wrote a custom
validator to check this. Trouble is, the validator is only tied to one
control (currently the month dropdown), which means that the validation
isn''t fired when the other control''s value changes.

Is there a way of getting the client-side validation code to fire when
either one of two controls is changed? TIA

--
Alan Silver
(anything added below this line is nothing to do with me)

解决方案

These validation controls opened up a whole new world for me:

http://www.peterblum.com/VAM/Home.aspx

You can fulfill your requirement, plus more.

--
Jay Douglas
http://www.jaydouglas.com
"Alan Silver" <al*********@nospam.thanx> wrote in message
news:jw**************@nospamthankyou.spam...

Hello,

I have two dropdown controls on a form, representing a month/year
combination. The date entered must be in the future, so I wrote a custom
validator to check this. Trouble is, the validator is only tied to one
control (currently the month dropdown), which means that the validation
isn''t fired when the other control''s value changes.

Is there a way of getting the client-side validation code to fire when
either one of two controls is changed? TIA

--
Alan Silver
(anything added below this line is nothing to do with me)



>These validation controls opened up a whole new world for me:


http://www.peterblum.com/VAM/Home.aspx

You can fulfill your requirement, plus more.



Thanks, they look very good.

I assume from your answer that what I want to do can''t easily be done in
ASP.NET? I wondered if the changes in 2.0 had brought any improvements
to the validation controls.

Thanks for the reply

--
Alan Silver
(anything added below this line is nothing to do with me)


From what I''ve noticed, the validation controls in 2.0 have not made great
gains in the way of functionality. There are some new things like setting
focus on error and a few other items.

--
Jay Douglas
http://www.jaydouglas.com
"Alan Silver" <al*********@nospam.thanx> wrote in message
news:iw**************@nospamthankyou.spam...

These validation controls opened up a whole new world for me:

http://www.peterblum.com/VAM/Home.aspx

You can fulfill your requirement, plus more.



Thanks, they look very good.

I assume from your answer that what I want to do can''t easily be done in
ASP.NET? I wondered if the changes in 2.0 had brought any improvements to
the validation controls.

Thanks for the reply

--
Alan Silver
(anything added below this line is nothing to do with me)



这篇关于我可以一次将验证器绑定到两个控件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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