date validate

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andrew

    date validate

    Hi,

    How can I validate a date, like 3/26/04, before submitted?
    Thanks for any idea.

    --
    Andrew



  • Ray at

    #2
    Re: date validate

    If you want to do it BEFORE it's submitted, you'd want to use client-side
    code for that, not ASP.

    If you want ASP examples, can you answer these questions?

    1. Validate it in what way? That it's a valid date? That it's a specific
    day of the week? The the day number of the year is a primary number? That
    it's not in the future? That it's one of a few in a list of specific dates?
    ETc. etc.

    2. What language are you using in your ASP pages?

    Ray at work

    "Andrew" <dunggaze@yahoo .com> wrote in message
    news:sj29c.2$Bq d1.1@news04.blo or.is.net.cable .rogers.com...[color=blue]
    > Hi,
    >
    > How can I validate a date, like 3/26/04, before submitted?
    > Thanks for any idea.
    >
    > --
    > Andrew
    >
    >
    >[/color]


    Comment

    • Andrew

      #3
      Re: date validate

      Yes, I want client side validation samples. Because the datetime field of
      table of DB only accept 03/26/2004, 3/26/2004 or 03/26/04, how can I make a
      client side script to validate the date value? I prefer Jscript to VBs in
      client side, and reverse in server side. Thanks

      --
      Andrew


      "Ray at <%=sLocation% > [MVP]" <myfirstname at lane34 dot com> wrote in
      message news:OejY5R4EEH A.2600@TK2MSFTN GP09.phx.gbl...[color=blue]
      > If you want to do it BEFORE it's submitted, you'd want to use client-side
      > code for that, not ASP.
      >
      > If you want ASP examples, can you answer these questions?
      >
      > 1. Validate it in what way? That it's a valid date? That it's a[/color]
      specific[color=blue]
      > day of the week? The the day number of the year is a primary number?[/color]
      That[color=blue]
      > it's not in the future? That it's one of a few in a list of specific[/color]
      dates?[color=blue]
      > ETc. etc.
      >
      > 2. What language are you using in your ASP pages?
      >
      > Ray at work
      >
      > "Andrew" <dunggaze@yahoo .com> wrote in message
      > news:sj29c.2$Bq d1.1@news04.blo or.is.net.cable .rogers.com...[color=green]
      > > Hi,
      > >
      > > How can I validate a date, like 3/26/04, before submitted?
      > > Thanks for any idea.
      > >
      > > --
      > > Andrew
      > >
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Ray at

        #4
        Re: date validate


        "Andrew" <dunggaze@yahoo .com> wrote in message
        news:RA29c.31$B qd1.1@news04.bl oor.is.net.cabl e.rogers.com...[color=blue]
        > Yes, I want client side validation samples.[/color]

        This group focuses on server-side programming. If you want to use client
        side, try a javascript group or m.p.scripting.j script.
        [color=blue]
        > Because the datetime field of
        > table of DB only accept 03/26/2004, 3/26/2004 or 03/26/04,[/color]

        Oh really? what kind of odd database system is this? Please READ this.
        http://www.aspfaq.com/show.asp?id=2260 If you don't read at all, at least
        search the page for "YYYYMMDD" and read the area around it.

        Ray at work


        Comment

        • Ray at

          #5
          Re: date validate

          I meant "If you don't read IT all." I wasn't trying to say you don't read
          AT all. Oops!

          Ray at work

          "Ray at <%=sLocation% > [MVP]" <myfirstname at lane34 dot com> wrote in
          message news:uAOwZg4EEH A.1228@TK2MSFTN GP11.phx.gbl...
          [color=blue]
          > If you don't read at all, at least
          > search the page for "YYYYMMDD" and read the area around it.
          >[/color]


          Comment

          • Peter Foti

            #6
            Re: date validate

            "Andrew" <dunggaze@yahoo .com> wrote in message
            news:RA29c.31$B qd1.1@news04.bl oor.is.net.cabl e.rogers.com...[color=blue]
            > Yes, I want client side validation samples. Because the datetime field of
            > table of DB only accept 03/26/2004, 3/26/2004 or 03/26/04, how can I make[/color]
            a[color=blue]
            > client side script to validate the date value? I prefer Jscript to VBs in
            > client side, and reverse in server side. Thanks[/color]

            Keep in mind that client side validation is not reliable. What happens when
            someone comes along with JavaScript turned off? If this is critical, you
            would be better off doing this server side, or possibly both (JavaScript to
            provide instant validation, Server Side to catch those that fall through the
            cracks by having JS turned off).

            Regards,
            Peter Foti


            Comment

            Working...