473,513 Members | 6,210 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Required field validator static text does not display

Hi,
I am having a problem with displaying a * to a required field.

There seems to be a problem with this and the static value does not
appear unless you submit the page.
I am trying to display the static text as soon as the page is loaded
in the browser.

Does anyone know if there is a bug with the aps.net validator
controls? Or is this not possible.
I also have a summary validator control.

A sample :-

<asp:textbox id="txtSurname" Runat="server"
MaxLength="50"></asp:textbox>
<asp:requiredfieldvalidator display="static" id="valSurname"
Runat="server" Visible="True" ControlToValidate="txtSurname"
ErrorMessage="Surname must be entered.">*</asp:requiredfieldvalidator>

Thanks Milan
Nov 18 '05 #1
4 16729

"Milan" <ms****@hotmail.com> wrote in message news:8e**************************@posting.google.c om...
Hi,
I am having a problem with displaying a * to a required field.

There seems to be a problem with this and the static value does not
appear unless you submit the page.
I am trying to display the static text as soon as the page is loaded
in the browser.

Does anyone know if there is a bug with the aps.net validator
controls? Or is this not possible.
I also have a summary validator control.


Sorry, the validator doesn't work this way.
Both "Text" and "ErrorMessage" are only shown after an error-check
(on submit for instance). If you have a validation summary, then the
"ErrorMessage" is shown in that summary, the "Text" is always shown
on the position of the validator.

Hans Kesting
Nov 18 '05 #2
Hi,
The purpose of Display property is something else. If you set it to static,
it indicates that space should be reserved for error messages in the page
flow layout on the browser window; it does not mean validator control error
msgs should be displayed on page load itself.

One option to show the '*' on initial page display itself is to call the
page's Validate() method in the page load event.

Hoep this helps.

"Milan" <ms****@hotmail.com> wrote in message
news:8e**************************@posting.google.c om...
Hi,
I am having a problem with displaying a * to a required field.

There seems to be a problem with this and the static value does not
appear unless you submit the page.
I am trying to display the static text as soon as the page is loaded
in the browser.

Does anyone know if there is a bug with the aps.net validator
controls? Or is this not possible.
I also have a summary validator control.

A sample :-

<asp:textbox id="txtSurname" Runat="server"
MaxLength="50"></asp:textbox>
<asp:requiredfieldvalidator display="static" id="valSurname"
Runat="server" Visible="True" ControlToValidate="txtSurname"
ErrorMessage="Surname must be entered.">*</asp:requiredfieldvalidator>

Thanks Milan
Nov 18 '05 #3
Okay. you're looking at 2 different things. The First is the Asterisk that
should always be displayed, which is really just a visual decoration for the
textbox, and then there's the validation control, which is a behavior.

Take the Asterisk out of the validation control totally. The next to the
text box, type an asterisk and format it whatever way you want.

"Milan" <ms****@hotmail.com> wrote in message
news:8e**************************@posting.google.c om...
Hi,
I am having a problem with displaying a * to a required field.

There seems to be a problem with this and the static value does not
appear unless you submit the page.
I am trying to display the static text as soon as the page is loaded
in the browser.

Does anyone know if there is a bug with the aps.net validator
controls? Or is this not possible.
I also have a summary validator control.

A sample :-

<asp:textbox id="txtSurname" Runat="server"
MaxLength="50"></asp:textbox>
<asp:requiredfieldvalidator display="static" id="valSurname"
Runat="server" Visible="True" ControlToValidate="txtSurname"
ErrorMessage="Surname must be entered.">*</asp:requiredfieldvalidator>

Thanks Milan

Nov 18 '05 #4
Hi,
Thanks for clarifying how the validators work. I tried the page.validate on
page load and it partially does the trick, but other error messages show up
in the summary.

I will use the obvious method of displaying the asterisks as mentioned by
David.
Milan
"David Jessee" wrote:
Okay. you're looking at 2 different things. The First is the Asterisk that
should always be displayed, which is really just a visual decoration for the
textbox, and then there's the validation control, which is a behavior.

Take the Asterisk out of the validation control totally. The next to the
text box, type an asterisk and format it whatever way you want.

"Milan" <ms****@hotmail.com> wrote in message
news:8e**************************@posting.google.c om...
Hi,
I am having a problem with displaying a * to a required field.

There seems to be a problem with this and the static value does not
appear unless you submit the page.
I am trying to display the static text as soon as the page is loaded
in the browser.

Does anyone know if there is a bug with the aps.net validator
controls? Or is this not possible.
I also have a summary validator control.

A sample :-

<asp:textbox id="txtSurname" Runat="server"
MaxLength="50"></asp:textbox>
<asp:requiredfieldvalidator display="static" id="valSurname"
Runat="server" Visible="True" ControlToValidate="txtSurname"
ErrorMessage="Surname must be entered.">*</asp:requiredfieldvalidator>

Thanks Milan


Nov 18 '05 #5

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

Similar topics

5
2400
by: Do | last post by:
Hi, Has anybody run into problems with Page.IsValid? My errors show up when the fields aren't filled correctly, but my processing continues even if the page is invalid. I leave name and...
6
2261
by: hansiman | last post by:
I'm having trouble getting the required field validator to work. I can still save the row in the datagrid... I can't see what I'm doing wrong. <asp:TemplateColumn SortExpression="c.Password"...
2
2340
by: pmud | last post by:
Hi, I have an ASP.Net web page . The page was working fine until I added a required field field validator. My page has a link button which takes the user to another page, a submit button which...
1
280
by: Sparky Arbuckle | last post by:
<asp:RequiredFieldValidator id="rfvMenuSearch" ControlToValidate="tbSearch" Display="static" ErrorMessage="Enter Search String" runat="SERVER" /> How can I add an Expression Validator to this...
3
2701
by: Kivak Wolf | last post by:
Hi, Could someone give me a quick review of how to use the required field Validator? I'm completely at a loss, and MSDN does not help one bit. =/ Basically all I want done is to make sure that...
1
7322
by: spidur1 | last post by:
For some reason these fields are not being validated before the postback. Here the HTML page. Am I missing something from the validator controls that needs to be set? <table cellpadding="0"...
0
1982
by: dinsdale | last post by:
Wow, this is a really embarassing thing to have to ask about... I have an asp.net page with a multiview control in it. We want to enter person info in a semi - wizard style and I wanted to use...
2
3895
by: akshalika | last post by:
Hi, I have a repeater control. it dynamically bind textbox or dropdown base on some condition. i want to bind required field validator dynamically for validate textbox or dropdown. here is my...
1
19791
DebadattaMishra
by: DebadattaMishra | last post by:
Introduction In case of rich applications, you must have observed that a text field behaves like a dynamic combo box. When the user enters some characters in the text field, a popup will come up...
0
7254
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
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7373
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
7519
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5677
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
5079
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
4743
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
3230
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...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.