Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Q: compare validator for date (http://www.velocityreviews.com/forums/t108767-q-compare-validator-for-date.html)

=?Utf-8?B?SklNLkgu?= 08-26-2005 02:27 PM

Q: compare validator for date
 
Hello,

I put a compare validator in to my applications and set the type as Date. It
works for “MM/dd/yyyy” but not for “MM/dd/yyyy hh:mm:ss”. How can I validate
time part too?

Thanks,


Peter Blum 08-26-2005 02:53 PM

Re: compare validator for date
 
None of the built in validators handle time. When you use Type=Date, it only
means date.

You have several choices:
1. Create a custom validator that will handle the format you want.
2. I recommend splitting the date and time into two textboxes. This will
help the user in several ways:
- You can use a DatePicker with popup calendar for the date. There are many
available
- There are many separate time entry controls.
- You can assign a validator to individual textboxes and just validate the
format of a single data element. (With Date+Time, you have two elements that
may be incorrect. Users appreciate error messages that are specific.)

I created one of the available datepickers and time textboxes with my
Peter's Date Package (http://www.peterblum.com/datecontrols/home.aspx). You
can see a demo of date + time working together here:
http://www.peterblum.com/DateControl...Main.aspx#Demo (see "Demo 5").
My two controls are actually connected so that you assign one DateTime
object and puts the parts into the individual controls.
In addition, I've included validators for date and time.

--- Peter Blum
www.PeterBlum.com
Email: PLBlum@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"JIM.H." <JIMH@discussions.microsoft.com> wrote in message
news:8601F43F-ECAB-49B4-A6CC-3AA016E22F29@microsoft.com...
> Hello,
>
> I put a compare validator in to my applications and set the type as Date.
> It
> works for "MM/dd/yyyy" but not for "MM/dd/yyyy hh:mm:ss". How can I
> validate
> time part too?
>
> Thanks,
>




=?Utf-8?B?TWlsb3N6IFNrYWxlY2tp?= 08-26-2005 02:55 PM

RE: Q: compare validator for date
 
Hi,

I think you cannot do it using compare validator. Use Customvalidator
instead.
--
Milosz Skalecki
MCP, MCAD


"JIM.H." wrote:

> Hello,
>
> I put a compare validator in to my applications and set the type as Date. It
> works for “MM/dd/yyyy” but not for “MM/dd/yyyy hh:mm:ss”. How can I validate
> time part too?
>
> Thanks,
>


=?Utf-8?B?SklNLkgu?= 08-26-2005 03:03 PM

RE: Q: compare validator for date
 
I have never used CustomValidator, is there any example to show me what
exactly I should do?

"Milosz Skalecki" wrote:

> Hi,
>
> I think you cannot do it using compare validator. Use Customvalidator
> instead.
> --
> Milosz Skalecki
> MCP, MCAD
>
>
> "JIM.H." wrote:
>
> > Hello,
> >
> > I put a compare validator in to my applications and set the type as Date. It
> > works for “MM/dd/yyyy” but not for “MM/dd/yyyy hh:mm:ss”. How can I validate
> > time part too?
> >
> > Thanks,
> >


=?Utf-8?B?TWlsb3N6IFNrYWxlY2tp?= 08-26-2005 04:01 PM

RE: Q: compare validator for date
 
Hi,

This is very simple. Here you have quick tutorial tu validatiors:
http://samples.gotdotnet.com/quickst...alidation.aspx

--
Milosz Skalecki
MCP, MCAD


"JIM.H." wrote:

> I have never used CustomValidator, is there any example to show me what
> exactly I should do?
>
> "Milosz Skalecki" wrote:
>
> > Hi,
> >
> > I think you cannot do it using compare validator. Use Customvalidator
> > instead.
> > --
> > Milosz Skalecki
> > MCP, MCAD
> >
> >
> > "JIM.H." wrote:
> >
> > > Hello,
> > >
> > > I put a compare validator in to my applications and set the type as Date. It
> > > works for “MM/dd/yyyy” but not for “MM/dd/yyyy hh:mm:ss”. How can I validate
> > > time part too?
> > >
> > > Thanks,
> > >



All times are GMT. The time now is 07:00 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.