How can I autopopulate a second DateTime field and add days to it conditionally?

  • kdevlin1983
    Asked on January 19, 2017 at 11:02 PM
    Admin email show show start and end date in one week or two week increments.

     

    This is the form I am currently working in:

    https://form.jotform.com/procurement/gene--site-services-poster-request-

  • Support_Management Jotform Support
    Replied on January 20, 2017 at 2:09 AM

    Hello @kdevlin1983, sorry but I failed to understand what you're trying to do. Are you asking how to setup your Email Notifications for the admin, in a way that it will show a start and end date?

    If that's what you're trying to do, just add 2 DateTime Fields on your form (that will act as the Start and End date respectively), then add/include those 2 fields on your Email Notification:

    How can I autopopulate a second DateTime field and add days to it conditionally? Image 1 Screenshot 20

    Related guide: Setting-Up-Email-Notifications 

    In case we misunderstood your question, just get back to us with a bit more info and a clearer description of what you're trying to do so we can better assist you.

  • kdevlin1983
    Replied on January 20, 2017 at 12:47 PM

    Thank you. I was trying to ask if I could use the date and time field to populate an end date automatically in the admin without having the user pick an end date. If/then conditional logic to two radial buttons...if they select one week, the admin email would show date +7 days,; if they selecte two weeks, the admin email would show date +14 days?

  • Support_Management Jotform Support
    Replied on January 20, 2017 at 2:12 PM

    I see, thanks for clearing that up. Yes, it's possible to populate another DateTime field based on user input. Since I'm not sure how you want this incorporated on your form, I just created a simple test form showing how it works: https://form.jotform.com/70195972540965

    If you would test my form, ensure you will enter your email so you can get an idea of how the email would look like once it's received. You may also clone my form to better understand how it was setup.

    Related guide: How-to-clone-an-existing-form-from-a-URL

    Two conditions were created for this form - One for the 1 week option and another one for the 2 weeks option.

    How can I autopopulate a second DateTime field and add days to it conditionally? Image 1 Screenshot 30

    It's important that you should check that the Start Date field is filled out first to ensure that the End Date result is calculated properly when adding either 7 or 14 days.

    RESULT:

    How can I autopopulate a second DateTime field and add days to it conditionally? Image 2 Screenshot 41