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.

Limiting "Time Field" to office hours?

  1. I want to create an appointment booking form for an optician. I would like to use the Time Field, but not allow users to choose a time before 9:00am and after 5:30pm for their appointment. Is this possible please?

    Iain.

    Posted 12 years ago on Monday January 28, 2013 | Permalink
  2. I think you have two options. One would be to perform validation on the entered values to make sure they are not outside the office hours. You would use the gform_validation filter http://www.gravityhelp.com/documentation/page/Gform_validation to check the entered times and return an error if outside your business hours, or let the submission through if the hours are OK.

    The second option would be to use drop downs, and populate them with hours and minutes, or even just one drop down with hours and minutes in 15 minute increments. I don't think people are really looking to make an appointment at 10:08. Maybe 10:15 would be sufficient.

    You could create a drop down like this:

    9:00am
    9:30am
    10:00am
    10:30am
    11:00am
    11:30am
    12:00pm
    12:30pm
    etc

    I like the second option better from a usability standpoint. Will either of these work for you, or is there some other reason you want to use the time field?

    Posted 12 years ago on Tuesday January 29, 2013 | Permalink