473,756 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CompareValidato r and RequiredFieldVa lidator

Dear ASP.NET Programmers,

I am using a CompareValidato r 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 RequiredFieldVa lidator? Can't CompareValidato r handle this?
Thanks in advance,

Burak
Nov 18 '05 #1
2 2234
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 CompareValidato r 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 RequiredFieldVa lidator? Can't CompareValidato r 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 RequiredFieldVa lidator control to require the
user to enter data into the input control.

this answer your question
Regards
Martin

"buran" <bu***@buran.co m> wrote in message
news:Ou******** ******@TK2MSFTN GP12.phx.gbl...
Dear ASP.NET Programmers,

I am using a CompareValidato r 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 RequiredFieldVa lidator? Can't CompareValidato r 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
6399
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 differences between: CompareValidator.ControlToCompare=TextBox1, CompareValidator.ControlToValidate=TextBox2 and CompareValidator.ControlToValidate=TextBox1, CompareValidator.ControlToCompare=TextBox2?
0
1001
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! See datagrid code below: <asp:DataGrid id="gridProducts" ....>
4
5106
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 if I do not enter anything in the form in IE, then form won't be submitted but in other browsers it is submitted. I checked that JavaScript is enabled in Netscape, Opera, Mozilla, Firefox,
2
3195
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 textbox. I also have a CompareValidator pointed to the textbox with its Type="Date." Despite all documentation to the contrary, I am getting an exception when the page first loads that is thrown by the CompareValidator, complaining that it...
4
1896
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 compare set, and the page just behaves like the validator isn't there. Can anyone give me any ideas on what I need to do to make this work? It used to work and stopped, and I've even deleted and recreated both the text control and the validator...
11
8670
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 the textbox, but does NOT fire if the textbox is empty!! I thought the whole point of this validator was to ensure the control being validated had some text. Am I doing something stupid? It looks like I am going to need *two* validators for this,...
1
1458
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: <asp:TextBox ID="BirthDate" runat="server" /> <asp:CompareValidator ID="BirthDateValidation" runat="server" ControlToValidate="BirthDate" Type="Date" Text="Enter date of birth!" /><br />
1
1417
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" ValidationGroup="BirthDate" /> It works fine, but when I add CompareValidator with Type: <asp:CompareValidator ID="BirthDateValidator" runat="server"
1
1316
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 works fine; but when I add:
0
9456
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9713
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8713
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7248
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6534
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5142
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3358
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.