Date Validation

Results 1 to 3 of 3

Thread: Date Validation

  1. #1
    Join Date
    Dec 1969

    Default Date Validation

    Hi does anyone know the code whereby I could validate a date, it has to be in DD/MM/YY format so basically I need to check that there is a / in the third and fifth position, and also if possible that there are only 2 numbers before the first slash, 2 numbers after the first slash and 2 numbers after the second slash. Thanks!!

  2. #2
    Dan Evans Guest

    Default RE: Date Validation

    If you want to validate a date check the post below. If you want to ensure a string is in date format you can use a regular expression. In this one we&#039;re looking for 00/00/ so 19/08/1980 is valid and 45/02/1 is also valid:<BR>str = "19/08/1980";<BR>if (str.match(/^d{2}/d{2}//)) alert("Ok");<BR><BR>For an explanation of what that code actually means, try here:<BR><BR><BR>H ope this helps,<BR><BR>-Dan<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default Thanks


Posting Permissions

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