CDate function

Results 1 to 2 of 2

Thread: CDate function

  1. #1
    Join Date
    Dec 1969

    Default CDate function

    Hi, I have been using the CDate function recently and all is going generally well. I have form field posting to a script which verifies someones age. However, although the script works well, if the user doesn&#039;t type there DOB in the format: dd/mm/yyyy then i get an error. Is there anyway i can alter the script to recognise whether or not what was tyoed into the form field by the user is in the format dd/mm/yyyy, and if not, then redirect them?<BR><BR>All help appreciated<BR><BR>Webboy

  2. #2
    Join Date
    Dec 1969

    Default RE: CDate function

    Yes, you could easily test that the date is valid, there are numerous free JavaScript functions that do that.<BR><BR>BUT what they won&#039;t do is tell you if 10/3/03 is 10th March 2003 or 3rd October 2003.<BR><BR>You could get them to pick the day, the month & the year from dropdown boxes, but then you will need to deal with people entered their DOB as 31 Feb etc.

Posting Permissions

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