validate Date input using Custom Validator

Discussion in 'ASP .Net' started by Grey, Jan 20, 2004.

  1. Grey

    Grey Guest

    how to use Custom Validator to valid the date input, such as Feb does not have 30th or April does not have 31st....
    I don't want to use Calender control...
     
    Grey, Jan 20, 2004
    #1
    1. Advertising

  2. Grey

    Michael Guest

    If you don't "have" to use the custom validator, then why not use a compare
    validator? Set the Operator property of the validator to "DataTypeCheck",
    and the Type property to "Date".

    It's pretty smart too, I just tested it out and it validated (even on client
    side), leap years, and everything you mentioned in your post.

    --Michael
     
    Michael, Jan 20, 2004
    #2
    1. Advertising

  3. Grey

    tswachter

    Joined:
    Feb 1, 2009
    Messages:
    1
    Change the Operator Property

    The operator property for the compare validator must be set to "DataTypeCheck"

    Check MSDN for detail msdn.microsoft.com/en-us/library/ad548tzy.aspx
     
    tswachter, Feb 1, 2009
    #3
  4. Grey

    grish

    Joined:
    Oct 9, 2012
    Messages:
    1
    hiii i tried ur way bt i wish to validate only one field of date and if i use compare validator dn what shall i enter in controltovalidate and controltocompare.
     
    grish, Oct 9, 2012
    #4
    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. Fernando Lopes
    Replies:
    2
    Views:
    593
    Peter Blum
    Nov 19, 2004
  2. Marcus Leon
    Replies:
    1
    Views:
    3,319
    Marcus Leon
    Jun 30, 2003
  3. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,332
    Michael Borgwardt
    May 30, 2004
  4. =?Utf-8?B?TWlrZSBDb2xsaW5z?=

    Custom Validator to validate certain items checked in a checkboxli

    =?Utf-8?B?TWlrZSBDb2xsaW5z?=, Aug 10, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    1,312
    =?Utf-8?B?TWlrZSBDb2xsaW5z?=
    Aug 10, 2006
  5. Shailesh Katti

    compare validator to validate date in user control

    Shailesh Katti, Jul 27, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    786
    Teemu Keiski
    Jul 28, 2003
Loading...

Share This Page