Dynamically generating & saving a date based on user selection

  • petersnewjobs
    Asked on March 26, 2015 at 9:22 AM

    I'm sure this has been done before.

    I want to create an End Date field that is automatically updated based which subscription a user purchases. This End Date data would be then passed onto MailChimp (I'm good with the JotForm/MC integration).

    End Date = Current Date + Length of Subscription. (Length will be either 95 days or 367 days)

    I was looking at one of the Date widgets to give me the current date but I'm not sure how to add the extra days to the current date and save it in a new date type field.

    Is this possible?

    Thanks

  • David JotForm Support
    Replied on March 26, 2015 at 11:41 AM

    Hi,

    Our conditions will actually allow you to update a date field based on the value in another date field and will allow you to simply add a value to it.  Here is the condition I used:

    Dynamically generating & saving a date based on user selection Image 1 Screenshot 30

    Dynamically generating & saving a date based on user selection Image 2 Screenshot 41

    Since the date is always filled, the second date field will show as the current date plus 95 days.  Here is my quick test form to show you how it works:

    http://form.jotformpro.com/form/50844949917976

    Adjust the equation to suit your subscription lengths.

    Let us know if you have any further questions and we will be happy to help.

  • petersnewjobs
    Replied on March 26, 2015 at 8:59 PM

    Perfect. Your example highlighted that I was using the wrong field types when working with the date manipulations. Right field type and the conditional calculations and we're golden. Thanks.

  • jonathan
    Replied on March 26, 2015 at 11:01 PM

    On behalf of our colleague DAvid, you are quite welcome! =)

    Contact us again anytime should you need more assistance.

     

    Cheers!