Questions tagged [comparevalidator]
68 questions
14
votes
4 answers
Asp.net compare validator to validate date
As you all know Compare validators can be used to validate dates and check based on operator type (<, <= , >= etc). I have set the cultureinvariantvalues="true" property to validate two textbox controls that hold dates. I have to constrain them such…

Deeptechtons
- 10,945
- 27
- 96
- 178
11
votes
3 answers
Yii2 Compare Validator alert not disappear
I type a password and then I repeat it on repeat password field but red alert didn't disappear, and when I click submit button it was success and no error validation.
How to make compare alert disappear when I repeated password?
Here's my rules…

Dedy Kurniawan
- 286
- 2
- 3
- 9
11
votes
5 answers
Using the CompareValidator control to compare user input date with today's date
hey..i would like to compare the current date with the date entered by user..however, i'm encountering errors so far..
i tried something like this:

HelloBD
- 387
- 4
- 14
- 27
6
votes
1 answer
ASP.NET: Validate text box contains integer greater than equal to zero?
If I want to validate that a text box contains an integer greater than or equal to zero. Do I need to use TWO asp:CompareValidator controls: one with a DataTypeCheck operator and one with a GreaterThanEqual operator?
Or is the datatype operator…

User
- 62,498
- 72
- 186
- 247
5
votes
2 answers
CompareValidator without RequiredFieldValidator?
So I've been looking all over and can't seem to find a similar problem.
Basically, it seems like using CompareValidator doesn't work without a RequiredFieldValidator.
4
votes
1 answer
Dropdownlist and field validation is causing a riot
For some reason, I can't get the validator to raise a flag when I do things wrong.

DoStuffZ
- 785
- 15
- 37
4
votes
3 answers
How can I use CompareValidator for times without dates?
When I enter 9:00 into the Start control, and 16:00 into Finish; the code below fails validation.
Does anybody know a way I can use the ASP.NET validator for times without the dates?
Start (hh:mm)

John MacIntyre
- 12,910
- 13
- 67
- 106
4
votes
1 answer
How to validate time using compare validator?
How to validate time using compare validator?
I have a Editable gridview that contain 2 column for time Start & End Time and I want to validate them that star time must be earlier than end time. I have 24 hour format.
For Example If I entered Start…

MohammadMMohammad
- 305
- 5
- 14
3
votes
2 answers
Time validation using CompareValidator
As a (sorta) follow on from the following question - CustomValidator time c#.net - I would like to know if it is possible to use the CompareValidator to validate a time in a ASP.NET textbox?
I have attempted the following

Maxim Gershkovich
- 45,951
- 44
- 147
- 243
3
votes
3 answers
Start Date - End Date validation using Compare Validator Misfires
I need my end date to be always greater than start date, I tried validation using CompareValidator.
Code is as follows:
I have a text box start date

3lokh
- 891
- 4
- 17
- 39
2
votes
1 answer
Why is my MaskedEditValidator is not working?
I have following controls in my page, my CompareValidator works, but not the MaskedEditValidator. Am I missing anything?

GLP
- 3,441
- 20
- 59
- 91
2
votes
1 answer
How to hide CompareValidators and RegularExpressions until they are needed
I write in asp.net with c# code and some jscript.
I’m using CompareValidators and RegularExpressions to validate certain fields. This is working fine except for one problem. The exception messages take up room which is distorts the look of the…

Bob Avallone
- 979
- 7
- 20
- 36
2
votes
2 answers
How to use compare validator to compare the data between two dropdownlists values?
I have two DropDownLists populated with Year-Dates, and I want to show an error message in the case where the second ddls value is less than the first ddls value.
This is the code I have used so far, and it doesn't work:

Null
- 511
- 5
- 22
2
votes
1 answer
How to compare multiple textboxes and fire validator if they arent equal c#
The issue I have is that I need a way to compare the values from 4 textboxes input by user with another 6 textboxes input by user. If they dont match then fire validation to stop progress. I use a label called 'lblH1' to show they need to match…

wubblyjuggly
- 919
- 3
- 13
- 33
2
votes
2 answers
CompareValidator date with time
I am using the following code to make sure my textbox has a valid date entered into it:

Pete
- 57,112
- 28
- 117
- 166