Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 that TextBox and it looks like it can't validate a disabled textfield, even if the value is set.

How can I solve this?

like image 581
Andrea Avatar asked Nov 06 '22 13:11

Andrea


1 Answers

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

like image 194
Andrea Avatar answered Nov 14 '22 23:11

Andrea