开发者

RequiredFieldValidator to validate a disabled textBox

I've got a TextBox in which user can input a their desired username. Underneath I've got a checkbox that once clicked it copies the user's email adress into the textfield and then disable it to prevent further changes. This feature is implemented by using jQuery.

The problem is that I've got a RequiredFieldValidator on th开发者_如何学Goat TextBox and it looks like it can't validate a disabled textfield, even if the value is set.

How can I solve this?


Just for future reference: I fixed this by setting the property "readonly" instead of "disabled".


You could use a custom validator control like in this sample:

http://asp.net-tutorials.com/validation/custom-validator/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜