SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2010
    1 Post(s)
    0 Thread(s)

    Validation help needed

    Hello everyone,

    Can anyone help me implement this with jquery.validate.js:

    -->There are three textboxes for Date of Birth. A date of birth is considered as valid if
    a) there are 2 digits, for day and month and 4 digits for year.
    b) month digits are from 01 to 12
    c) day digits are from 01 to 31 and compliant with month and year (meaning to February 29th on 2011, and no April 31st any year)
    --> invalid date or lack of entry for a field, the field should be in red, and the following message should appear:
    a) Message if unfilled birth date
    b) Message if invalid date:
    "Please verify the accuracy of the date of birth of the traveler [number of the passenger with invalid birth date]. For example a birth February 29, 2012: February 29, 2012".

    Ignore the styling portion, just validation help would be really great.


  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Christchurch, New Zealand
    104 Post(s)
    4 Thread(s)
    With jquery validate, dates are validated when the full date is in a single field.

    jQuery provides a standardised date picker, for when you want to provide the user with an easier way to provide a date.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Posting Permissions

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