473,387 Members | 1,515 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,387 software developers and data experts.

CompareValidator and RequiredFieldValidator

Dear ASP.NET Programmers,

I am using a CompareValidator control to check the values entered into a
texbox. The textbox is for currencies, so the property Operator is set to
DataTypeCheck and the Type property is set to Currency. However, I would
like to control check whether the user enters a value or not. Do I have to
add an RequiredFieldValidator? Can't CompareValidator handle this?
Thanks in advance,

Burak
Nov 18 '05 #1
2 2216
Hi Buran...
You need to use Requiredfield Validator to check whether User entered value or not.
"buran" wrote:
Dear ASP.NET Programmers,

I am using a CompareValidator control to check the values entered into a
texbox. The textbox is for currencies, so the property Operator is set to
DataTypeCheck and the Type property is set to Currency. However, I would
like to control check whether the user enters a value or not. Do I have to
add an RequiredFieldValidator? Can't CompareValidator handle this?
Thanks in advance,

Burak

Nov 18 '05 #2
Taken from MSDN :
Note If the input control is empty, no validation functions are called and
validation succeeds. Use a RequiredFieldValidator control to require the
user to enter data into the input control.

this answer your question
Regards
Martin

"buran" <bu***@buran.com> wrote in message
news:Ou**************@TK2MSFTNGP12.phx.gbl...
Dear ASP.NET Programmers,

I am using a CompareValidator control to check the values entered into a
texbox. The textbox is for currencies, so the property Operator is set to
DataTypeCheck and the Type property is set to Currency. However, I would
like to control check whether the user enters a value or not. Do I have to
add an RequiredFieldValidator? Can't CompareValidator handle this?
Thanks in advance,

Burak

Nov 18 '05 #3

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

Similar topics

1
by: edi | last post by:
Hi, Are there any differences between CompareValidator.ControlToCompare and CompareValidator.ControlToValidate? For example if I have TextBox controls: TextBox1 and TextBox2 what are the...
0
by: Sjaakie Helderhorst | last post by:
Hi, Somehow pushing an image-button doesn't trigger the CompareValidator, resulting in errors when entering string characters. Could someone please tell me what I did wrong? Thanks in advance!...
4
by: Joe | last post by:
Hello, I have created a login page using dotnet. I am using requiredFieldValidator and noticed that the code works fine in IE but not in Netscape, Opera, Mozilla, Firefox, etc. For example...
2
by: Eric Maia | last post by:
I have a textbox (StartDateTextBox) in a UserControl on my page, that is supposed to have a date entered into it. I have a RequiredFieldValidator that has its ControlToValidate property set to the...
4
by: MattB | last post by:
I have a page that has gone through a lot of editing. It has many text box and validator controls, and one compare validator just isn't working. I have the control to validate set, and control to...
11
by: Alan Silver | last post by:
Hello, I am using this validator on a textbox, and have discovered that if I set the InitialValue property, then the validator correctly fires if the user does not change the initial value of...
1
by: R.A.M. | last post by:
Hello, (Sorry for my English...) Could you help me please? I have a problem with CompareValidator control which makes the load of my page infinitive. Here's the code: Date of birth:...
1
by: R.A.M. | last post by:
Hello, I am learning ASP.NET 2.0 and I have a problem with CompareValidator control. On .aspx page I have a control: Date of birth: <asp:TextBox ID="BirthDate" runat="server"...
1
by: R.A.M. | last post by:
Hi, I am learning .NET 2.0 and I have a problem with asp:CompareValidator. On .aspx page I have: Birth date: <asp:TextBox ID="BirthDate" runat="server" ValidationGroup="BirthDate"/> and it...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
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
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...

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.