473,403 Members | 2,071 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,403 software developers and data experts.

RequiredFieldvalidator displays error too early

Hi there

I have a RequiredFieldValidator that displays the text "Required field" for
a textbox. The problem is, that the text "Required field" is displayed
BEFORE the user presses the button to accept the form. Why does this occure?
Must be some setting I've missed, cause in other forms it works as it
should, where the text is not displayed until the user click the accept
button.

My textbox and validator looks like this:

<asp:TextBox ID="tbFirstName" runat="server"
Width="204px"></asp:TextBox>
<asp:RequiredFieldValidator ID="reqFirstNameUser"
runat="server" ControlToValidate="tbFirstName"
Enabled="True" ErrorMessage="Required field"
Display="Dynamic">
</asp:RequiredFieldValidator>

Oct 23 '07 #1
1 1332
Sorry, this was posted to the wrong NG. I have posted it to the
aspnet.webcontrols NG instead, so just ignore this post.

"Preben Zacho" <pr**********@zacho-web.dkwrote in message
news:ud**************@TK2MSFTNGP05.phx.gbl...
Hi there

I have a RequiredFieldValidator that displays the text "Required field"
for a textbox. The problem is, that the text "Required field" is displayed
BEFORE the user presses the button to accept the form. Why does this
occure? Must be some setting I've missed, cause in other forms it works as
it should, where the text is not displayed until the user click the accept
button.

My textbox and validator looks like this:

<asp:TextBox ID="tbFirstName" runat="server"
Width="204px"></asp:TextBox>
<asp:RequiredFieldValidator ID="reqFirstNameUser"
runat="server" ControlToValidate="tbFirstName"
Enabled="True" ErrorMessage="Required field"
Display="Dynamic">
</asp:RequiredFieldValidator>
Oct 23 '07 #2

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

Similar topics

6
by: BK | last post by:
I'm having a really strange problem with and HtmlSelect server control (listbox) and a RequiredFieldValidator that I am trying to use to make sure that someone has items in the listbox. The way...
3
by: Steve Yerkes | last post by:
There seems to be way too much confusion over how to set focus on the a field using a field validator. I looked all over the web and found people trying to do this, but not getting anywhere. There...
3
by: me | last post by:
Is there any particular reason why a requiredfieldvalidator cant validate a listbox? I have bound the two together but the validator always returns false on isvalid and so does the Page, no matter...
7
by: Ed West | last post by:
Hello, I have a simple form with some input boxes. After validation if one fails, then I would like to at the top of the page say something like "The following fields in red are required" and...
4
by: James | last post by:
Hello, I have a RequiredFieldValidator for several textbox controls on a form. Here's an example with the RequiredFieldValidator. EnableClientScript, Enabled, and Visible are set to true for...
2
by: Hongbo | last post by:
Hi, I have a Asp.Net written in C#. It serve as information input form. The form encounters sort of random problem with the email field and state field. I have validator attached with these 2...
1
by: Giovanni | last post by:
Dear Friends, I need your help. I am trying to dynamically create a RequiredFieldValidator in the ItemCreated event of a DataList but cannot get it to work. The errors seem to revolve around...
1
by: Arpan | last post by:
Suppose I have the following RequiredFieldValidator control which validates a TextBox: <form id="form1" runat="server"> <asp:TextBox id="txtVal" runat="server"/> <asp:RequiredFieldValidator...
1
by: ggeorgiou | last post by:
Hi All, I have a simple form, which contains a asp textbox and a requiredfieldvalidator, with a submit button. I can run my website up locally and there is not a problem, and the form works...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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
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
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...

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.