Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How do I validate a ReadOnly Textbox using the RequiredFieldValida

Reply
Thread Tools

How do I validate a ReadOnly Textbox using the RequiredFieldValida

 
 
=?Utf-8?B?SWFu?=
Guest
Posts: n/a
 
      11-02-2006
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
 
Reply With Quote
 
 
 
 
=?Utf-8?B?SWFu?=
Guest
Posts: n/a
 
      11-02-2006
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?

"Ian" wrote:

> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Readonly textbox with scroll pv_kannan@yahoo.com ASP .Net 4 09-12-2005 06:56 PM
Double Click a readOnly Textbox to make it editable? Angela Chen ASP .Net 3 12-06-2004 06:31 AM
ASP.NET Readonly panel function with readonly checkbox, readonly radiobutton Jonathan Hyatt ASP .Net Web Controls 1 06-08-2004 07:42 PM
Textbox - always in readonly mode (Popup generated) doug albright ASP .Net 0 08-30-2003 07:32 AM



Advertisments