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.

Dynamically add time form is loaded + 30 mins

  1. gvnet
    Member

    Hi,

    I am hoping I can dynamically add a value to the time field (it is a pickup time for an order). When the form loads, I would like the time to be populated with the current time plus 30 mins.

    Is this possible?

    Also, can I generate an error if the time entered is less than current time + 30 mins?

    Many thanks.

    Posted 6 years ago on Saturday January 19, 2013 | Permalink
  2. Yes. You could use the gform_pre_render filter to change the value of a field before it's displayed. http://www.gravityhelp.com/documentation/page/Gform_pre_render

    You could also use the gform_validation http://www.gravityhelp.com/documentation/page/Gform_validation filter to check to be sure that the value actually submitted is greater than 30 minutes from the current time.

    Please provide a link to your form if you still need help with this.

    Posted 6 years ago on Monday January 28, 2013 | Permalink
  3. gvnet
    Member

    This looks useful but a little out of my depth of php.

    Do you have any examples/docs specifically relating to time and date fields that I might be able to tweak?

    Many thanks

    Posted 6 years ago on Monday January 28, 2013 | Permalink
  4. David Peralty
    Administrator

    We don't have any specific examples that would meet your needs at this time. Your best bet, if it is beyond your level of PHP knowledge is to hire a developer that could make this customization for you. We have a great Job Board on these forums, and I highly recommend jobs.wordpress.net as well. All my best!

    Posted 6 years ago on Monday January 28, 2013 | Permalink