473,486 Members | 2,429 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How do I validate a ReadOnly Textbox using the RequiredFieldValida

Ian
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
Nov 2 '06 #1
1 2876
Ian
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
Nov 2 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
8298
by: pv_kannan | last post by:
Hello, I am stuck with a problem trying to mimic the behavior of a Windows Forms Readonly textbox in HMTL/ASP.NET. Basically, I would like the text to be readonly and overflow the textbox...
10
7208
by: GP | last post by:
Is it possible to iterate through all the controls collection and make the textboxes alone as read only.I don't see a readonly property for the Control.Can some one help me in this context? I...
3
4067
by: Lyners | last post by:
I am having a hard time with this one, and I thought it would be easy. I have a datagrid in which I have textboxs for users to enter data. One of the fields in the database behind the datagrid...
4
2482
by: Doug Bell | last post by:
Hi, I needed to make a TextBox on a DataGrid ReadOnly based on the condition of another cell on its row. I achieved this using a Custom Data Column Class "DacDGTextColLotNo" but I can't get the...
9
2705
by: ShaneFowlkes | last post by:
Hey guys... I have a form that asks for several dates. I tried using asp calendar controls to set values of the date textboxes which were readonly. I found this annoying since each time I...
4
4588
by: H-S | last post by:
Please help. This is a real puzzler! Originally posted on microsoft.public.dotnet.framework.windowsforms but no answer found! I have a read-only textBox which shows the results of a selection...
1
18949
by: dilipkp | last post by:
hi all, actually i want to make a textbox readonly... dynamically i want to change the textbox readonly and editable.. so is there any way i can specify in the style, this readonly property, and...
2
11014
by: johnlim20088 | last post by:
Hi Someone please help me string typ; if (e.Row.RowType == DataControlRowType.DataRow) { typ = e.Row.Cells.Text;
7
1579
by: RolfHerbert | last post by:
Hi all, Source code below. I am using an sqldatasorce to populate a datagrid. I am using datakeyIds. I am interested in two keys which I have added to the datakeyids, however if either of the...
0
7105
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7132
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7180
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6846
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5439
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4870
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4564
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3076
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
600
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.