验证不可见的控件 [英] validating controls that are not visible

查看:87
本文介绍了验证不可见的控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个组合框和一个文本框.在任何一种情况下,它们都只可见.我已将必需的字段验证器应用于文本框.并使用了验证摘要.现在,我的问题是我只想使用一个控件如果我不使用文本框,我不希望它验证.如何避免这种情况?...

谢谢
Amit

Hey everyone,

i have a combobox and a text box.In either case only one of them is visible.I''ve applied required field validator to textbox.and used a validation summary.Now,my problem is that i want to use only one control out of them at a time.If i''m not using textbox.I don''t want it to validate.How can i avoid that?...

Thanks
Amit

推荐答案


阿米特,

在客户端启用或禁用ASP.Net验证
rfvOther:是必填字段验证器
崩溃

Hi
Amit,

Enable or Disable ASP.Net Validation on client side
rfvOther: is a Required Field Validator
Collapse

//Syntax:
ValidatorEnable(ValidatorContronName,Boolean);
//Explanation:ValidatorContronName - This is ClientID of the Validation control.
Boolean - true(Enable) / false(Disable)
//Example:
ValidatorEnable(document.getElementById('<%=rfvOther.ClientID%>'), fale);



您可以根据自己的逻辑来实现此功能.


如有任何疑问,请让我知道.

如果有帮助,请提供"投票",如果这是正确的答案,请提供"接受答案".:rose:

谢谢,
Imdadhusen



You can implement this function according you logic.


Please do let me know, if you have any doubt.

Please provide "Vote" if this would be helpful, and make "Accept Answer" if this would be correct answer.:rose:

Thanks,
Imdadhusen


这篇关于验证不可见的控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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