Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Date validation problem

Reply
Thread Tools

Date validation problem

 
 
John
Guest
Posts: n/a
 
      02-27-2005
Hi

I am using a compare validator to validate a text field for a date value.
The problem is that the validator does not accept a single digit year like
1/1/5 but would accept a two digit or four digit year like 1/1/05 or
1/1/2005. What is the problem and how can I fix it?

Thanks

Regards



 
Reply With Quote
 
 
 
 
Riki
Guest
Posts: n/a
 
      02-27-2005
John wrote:
> Hi
>
> I am using a compare validator to validate a text field for a date
> value. The problem is that the validator does not accept a single
> digit year like 1/1/5 but would accept a two digit or four digit year
> like 1/1/05 or 1/1/2005. What is the problem and how can I fix it?


If it's customary in your region to write a date as 1/1/5, then
apparently, the .NET framework is not aware of that.

So, I'll guess that you'll have to train your users to write 1/1/05,
or else you'll have to write a custom validator or a Regular Expression
validator.

--

Riki


 
Reply With Quote
 
 
 
 
John
Guest
Posts: n/a
 
      02-27-2005
Are you kidding? 1/1/5 is valid date everywhere. Sure day and month can swap
but otherwise it is a perfectly valid date. If framework does not understand
it then I'd say it is a bug in the fw.

Regards

"Riki" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> John wrote:
> > Hi
> >
> > I am using a compare validator to validate a text field for a date
> > value. The problem is that the validator does not accept a single
> > digit year like 1/1/5 but would accept a two digit or four digit year
> > like 1/1/05 or 1/1/2005. What is the problem and how can I fix it?

>
> If it's customary in your region to write a date as 1/1/5, then
> apparently, the .NET framework is not aware of that.
>
> So, I'll guess that you'll have to train your users to write 1/1/05,
> or else you'll have to write a custom validator or a Regular Expression
> validator.
>
> --
>
> Riki
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM
Given a date, how to find the beginning date and ending date of that week Matt ASP General 11 11-08-2003 11:24 PM
Given a date, how to find the beginning date and ending date of that week Matt ASP .Net 1 11-08-2003 09:14 PM
Given a date, how to find the beginning date and ending date of that week Matt C Programming 3 11-08-2003 09:07 PM
Given a date, how to find the beginning date and ending date of that week Matt C++ 2 11-08-2003 08:30 PM



Advertisments