473,288 Members | 2,350 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,288 software developers and data experts.

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 16708

"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
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
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
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
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
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
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
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
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
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.