简体   繁体   English

隐藏的验证程序控件仍在验证吗?

[英]Hidden Validator Controls Still Validate?

I've set up a page that uses JavaScript to hide or show rows in an HTML table, depending on the state of a checkbox. 我已经建立了一个页面,该页面使用JavaScript隐藏或显示HTML表中的行,具体取决于复选框的状态。

So far, so good. 到现在为止还挺好。 But this is a data entry form and some rows include validation controls. 但这是一个数据输入表单,某些行包含验证控件。 However, it appears that if I hide a row (using JavaScript: style.display = 'none' ) that contains a validation control, the control still validates on an attempt to postback. 但是,如果我隐藏了包含验证控件的行(使用JavaScript: style.display = 'none' ),则该控件仍会在尝试回发时进行验证。

Can anyone suggest a way I can do this but have the validation controls not do anything if that row is hidden? 谁能建议我一种方法,但是如果隐藏该行,让验证控件什么都不做?

您必须使用ValidatorEnable方法禁用验证器,方法是将其禁用: http : //geekswithblogs.net/jonasb/archive/2006/08/11/87708.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM