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.

Update a field based on two datepickers

  1. FormsDude
    Member

    I have tried searching the forums but havent found anything close as I need.
    I have datepicker #1 called 'Check in date' and datepicker #2 called 'Check out date'
    Then a field called 'Total number of nights' which I would like to populate dynamically based on the difference between the 2 datepicker fields.

    I would like this to update as soon as the datepicker is changed, not after the form is validated or submitted.

    Is this possible? This was the closest I found:
    http://www.gravityhelp.com/forums/topic/start-date-end-date-calculate-of-days-how#post-57054

    Thanks alot for your help.

    Posted 11 years ago on Thursday October 4, 2012 | Permalink
  2. You can do this, but you will have to do the calculation with jQuery on the front end. Take a look at this answer at Stackexchange: http://stackoverflow.com/a/1263826

    Posted 11 years ago on Thursday October 4, 2012 | Permalink