Hi ,
can a compareValidator compare a unique field
i saw the types Integer ; String ..
normally i used to compare 2 field
wondering if i can use it for one field ?
so (i will not use CustomeValidator in some case )
Thanks
Printable View
Hi ,
can a compareValidator compare a unique field
i saw the types Integer ; String ..
normally i used to compare 2 field
wondering if i can use it for one field ?
so (i will not use CustomeValidator in some case )
Thanks
When you use a compare validator, you need to compare it to something. Comparing something with itself doesn't make sense.
Yes logically ,
i found this mistake on MSDN training on Question & Answers
they say :
Q-To check if Date is Correct what you will use ?
A- CompareValidator (compare with Date type )
Thanks !
Very nice, do you have a link?
Here You The Link
page 44
Question 6
Thanks for that, I quite enjoyed it. Even more than that I enjoyed the waiting process followed by their 'CAPTCHA' image verification system.
Yep a little but when you download you will see its faster !Quote:
Originally Posted by mendhak
sorry !
I never paid attention in French class, but this
Does this meanQuote:
6. Déterminer si le format de date est correct.
CompareValidator (pour une comparaison avec le type Date)
?Quote:
Determine if the format of the date is correct
CompareValidator (for comparison with a date type)
If I'm now understanding you correctly, are you trying to determine if a date entered in a field is valid date? If so, you can specify the "Type" property of the CustomValidator but this does not work for all date formats, I believe it is quite limited in what it validates against data types...
Yes Exactly !
You want to mean CompareValidator ...
but they answered using compareValidator
That why i asked if can we use for a 1 field
as they wrote
Hmm... you can use the CompareValidator to validate whether something entered in a field is a valid type of data, but you cannot compare it to itself.
The answer, however, is still incorrect and you have indeed found a fallacy. Use a regular expression validator to find out if it's a date.
do you mean CustomValidator ?Quote:
Originally Posted by mendhak
No, a regular expression validator. It's different. You can specify a regular expression to match a pattern. Are you familiar with regular expressions? Think of it as a 'meta language' to describe what a string should look like.
For example, if I want to specify that I want to match an email address and ensure that the text entered is an email address, I can use this regular expression
The regular expression validator, when given that, will look at the text input into whatever field you've specified and match it against that pattern to ensure that it does follow those rules.Code:\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b
Similarly, you can use a regular expression validator for a date string.
Yes i know
Using it as Regex(preg_match ) with PHP
Never used on Asp.Net atm
Thanks !
I think you'll like it in ASP.NET. There is a codebehind implementation, a Regex class you can use. Give it a whirl. There's also a compiled option to make your pattern matches faster.
Thanks m8 for the info , sure i will see it !Quote:
Originally Posted by mendhak