Custom Date Format Validation

Discussion in 'ASP .Net' started by Andy, Apr 26, 2004.

  1. Andy

    Andy Guest

    I wish to validate the date a user has entered against the format dd
    mmm yyyy

    Using the CompareValidator and DataTypeCheck does not work and I
    suspect that a Regular Expression is over-engineering. Does anybody
    have a simple solution please?

    Many thanks in advance.
     
    Andy, Apr 26, 2004
    #1
    1. Advertising

  2. Hi Andy,

    when you are using the compare validator to compare to dates it uses the
    default culture info of your machine. so the simplest solution is to set the
    following line in your web.config with culture which has the dateformat " dd
    mmm yyyy".

    <globalization requestEncoding="utf-8" responseEncoding="utf-8"
    culture="en-GB" />

    HTH
    Regards
    Ashish M Bhonkiya

    "Andy" <> wrote in message
    news:...
    > I wish to validate the date a user has entered against the format dd
    > mmm yyyy
    >
    > Using the CompareValidator and DataTypeCheck does not work and I
    > suspect that a Regular Expression is over-engineering. Does anybody
    > have a simple solution please?
    >
    > Many thanks in advance.
     
    Ashish M Bhonkiya, Apr 27, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Candy
    Replies:
    2
    Views:
    1,209
    Janaka
    Feb 18, 2004
  2. Replies:
    0
    Views:
    441
  3. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,379
    Michael Borgwardt
    May 30, 2004
  4. Chu
    Replies:
    3
    Views:
    4,241
    Shawn
    Aug 15, 2006
  5. Josh Sharpe
    Replies:
    1
    Views:
    229
    Brian Candler
    Sep 21, 2010
Loading...

Share This Page