Results 1 to 5 of 5

Thread: Validating Dates Based On Selections

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2004
    Posts
    49

    Resolved Validating Dates Based On Selections

    Hi, i'm doing a web form which has a section for users to select the dates.
    I've got a drop down list for day, month and year respectively. How do i go about validating the dates?
    The VALUES for day are 1,2,3,4,5 and so on.
    The VALUES for month are 1,2,3,4,5 and so on.
    The VALUES for year is 2005.

    The "VALUES" stated above refers to the returned value when i do a dropdownlist.SelectedValue()

    I've tried using the IsDate function but doesn't get the desired results. I would like to check if the date is valid, if it is not valid, i'll inform the user by informing the user using a label.
    Last edited by Lex@SG; Feb 20th, 2005 at 12:07 PM. Reason: Ans Found!

  2. #2
    Addicted Member rdove's Avatar
    Join Date
    Dec 2002
    Location
    Indianapolis
    Posts
    251

    Re: Validating Dates Based On Selections

    what results did you get with the IsDate function?

    You should be able to do this:

    VB Code:
    1. If Not IsDate(strMonth & "/" & strDay & "/" & strYear) Then
    2.      'display error
    3. End If
    ~Ryan





    Have I helped you? Please Rate my posts.

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 2004
    Posts
    49

    Resolved Re: Validating Dates Based On Selections

    Thanks alot, it works!

  4. #4

    Thread Starter
    Member
    Join Date
    Dec 2004
    Posts
    49

    Exclamation Re: Validating Dates Based On Selections

    how do i check if the date selected is later than today's date?

  5. #5

    Thread Starter
    Member
    Join Date
    Dec 2004
    Posts
    49

    Resolved Re: Validating Dates Based On Selections

    Quote Originally Posted by Lex@SG
    how do i check if the date selected is later than today's date?
    i've found the ans to my qn....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width