开发者

validation in asp.net using validators

开发者 https://www.devze.com 2023-01-13 14:43 出处:网络
i am using validator for validating blank textbox. my problem is,i want to ma开发者_C百科ke the validation to false means the textbox can be blank,when i select Complete from dropdownlist.

i am using validator for validating blank textbox. my problem is,i want to ma开发者_C百科ke the validation to false means the textbox can be blank,when i select Complete from dropdownlist.

How can i do this.


You can disable an ASP.NET validator using JavaScript. Tap into the onchange JavaScript event on your drop down list to invoke the disabling code, and that should do it.

Alternatively, if your combo box is posting back, you can disable or hide the validator in code behind by setting its Visible or Enabled property to false.


Handle it in the dropdownlist change event, set the Enabled property of the validation control to false.

Or thru JavaScript set the validation control enabled to false. Note: Validation control must be set to EnableClientScript=true.

0

精彩评论

暂无评论...
验证码 换一张
取 消