PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Sort by birthdate

  1. park13
    Member

    I have a form that requires a birthday. Is there a way to automatically add age group based on birthday ? for example if the person enter 09/07/2000 they are put into the U13 age group?

    U9 8/1/04 – 7/31/05
    U10 8/1/03 – 7/31/04
    U11 8/1/02 – 7/31/03
    U12 8/1/01 – 7/31/02
    U13 8/1/00 – 7/31/01
    U14 8/1/99 – 7/31/00
    U15 8/1/98 – 7/31/99
    U16 8/1/97 – 7/31/98
    U17 8/1/96 – 7/31/97
    U18 8/1/95 – 7/31/96

    Posted 11 years ago on Thursday December 13, 2012 | Permalink
  2. You will have to perform this calculation and store the age group yourself. You can use the gform_pre_submission filter http://www.gravityhelp.com/documentation/page/Gform_pre_submission and read the date which is entered, then store the age group in a hidden or admin only field. You will probably want to make the code such that it works year over year (i.e. the birth dates for U13 players will be different next year, and you don't want to have to update this code every year.)

    Posted 11 years ago on Friday December 14, 2012 | Permalink
  3. park13
    Member

    Is there a tutorial or sample on how to do this?

    Posted 11 years ago on Friday December 28, 2012 | Permalink
  4. David Peralty

    There isn't as this is a customization that no one has asked for before. You would have to hire a developer to do this for you if you don't feel that you can take it on. It should be relatively simple for an intermediate level or above PHP developer.

    Posted 11 years ago on Friday December 28, 2012 | Permalink