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.

Price calculation based on birthdate

  1. Hey,

    I'm totally loving Gravity Forms and using it on 1 of my websites for all different sort of forms.

    One of those forms is a membership signup. I could create all fields with no problem but can't figure out how I can determine the price they have to pay.

    Basically, the price is determined on when they were born :
    ex.
    20 € if born in 2003 and later
    60 € if born between 2002 & 1993
    ...

    can this somehow be calculated? Off course there is a datepicker field for the birthdate.

    Thanks in advance!

    Posted 11 years ago on Monday November 12, 2012 | Permalink
  2. David Peralty

    We don't have an easy way of doing this currently as you can't use conditional logic against date picker fields. It would require custom JavaScript and/or PHP code to make happen automatically. I just don't know of any built-in way to do this.

    Posted 11 years ago on Monday November 12, 2012 | Permalink
  3. hmm... too bad :( that would make the signup form awesome... We have to let our registrants know somehow how much they have to pay.

    Posted 11 years ago on Monday November 12, 2012 | Permalink
  4. David Peralty

    You could have a radio button that has the two options and then conditional logic for each of those choices. That would then give you the result you want.

    Posted 11 years ago on Monday November 12, 2012 | Permalink
  5. what would I put on the radiobuttons? Have them choose in which "age category" they reside? Or how exactly do you mean?

    Posted 11 years ago on Monday November 12, 2012 | Permalink
  6. David Peralty

    Yeah, age category. One choice or the other. You couldn't have the price updated through conditional logic on a date field, best solution I could come up with.

    Posted 11 years ago on Monday November 12, 2012 | Permalink
  7. been browsing the support docs about including javascript somehow...

    Could I perhaps use the "Gform post render" to have a hidden (or read-only) field populated based on a query I make?

    I should be able to use javascript to retrieve the year out of the date dropdown I use, compare it to the current date and fill the destination field with the right price?

    Coding that is another thing however :)

    Posted 11 years ago on Monday November 12, 2012 | Permalink
  8. David Peralty

    Yeah, I am no JS expert, and as such, I can't give you any ideas on how to do it. A coder, wise in the way of JS could probably do most of what you need without any knowledge of Gravity Forms.

    Posted 11 years ago on Monday November 12, 2012 | Permalink
  9. same here... no JS expert either... will have to check if I know someone who does :)

    Posted 11 years ago on Tuesday November 13, 2012 | Permalink