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/
精彩评论