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.

Check In & Check Out Date Selection

  1. geekyumang
    Member

    I have to setup the form in such a way that Check Out date is post Check In date selected and also, I am able to find out the number of days between the two.

    It would be helpful if someone could post on how to achieve this.

    Posted 11 years ago on Saturday December 8, 2012 | Permalink
  2. If you need to restrict the date so that check out is post check in (like a hotel stay) you can perform this validation after submission, using the gform_validation filter http://www.gravityhelp.com/documentation/page/Gform_validation

    Commonly online, this functionality is provided on the front end, so that once a check in date is selected (which cannot be in the past) that the check out dates are only post-check in date. That functionality is provided on the front end by JavaScript. You can use jQuery to modify the date pickers on your web page. You can find documentation here: http://jqueryui.com/datepicker/

    Regarding the number of days between the two, you will have to write the PHP to do the math yourself. You can compare dates and then store the number of days, in the entry, using the gform_pre_submission_filter http://www.gravityhelp.com/documentation/page/Gform_pre_submission_filter

    This sort of data-based functionality is not built in to Gravity Forms but can be added by using the built in hooks and filters offered by Gravity Forms.

    Posted 11 years ago on Wednesday January 2, 2013 | Permalink