How do I validate a ReadOnly Textbox using the RequiredFieldValida

G

Guest

I have an ASP.NET 2.0 page with a readonly textbox on it who's value is
populated by a popup child window used for selecting from a list. I use a
javascript function to pass the data back to the parent using the name of the
textbox with the parent form. This all works fine, except when I click Save
on the Parent form and require the client side RequiredFieldValidator to
trigger. This validator results in showing the error message pertaining to
the fact that the readonly textbox is empty

Any ideas

Much appreciated
Ian
 
G

Guest

To get around this I have used this code in the Page_Load event

txtTextbox.Attributes.Add("readonly", "true");

However, this appears to be a dirty hack to me

Is there another solution?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top