# Time limits using an advanced Time field \[RESOLVED\]

**URL:** <https://community.gravityforms.com/t/time-limits-using-an-advanced-time-field-resolved/8450>\
**Category:** Get Help\
**Tags:** time-field\
**Created:** [March 25, 2021, 3:17pm UTC](https://community.gravityforms.com/t/time-limits-using-an-advanced-time-field-resolved/8450 "2021-03-25T15:17:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![user5e5f0c2b1d27a637](https://avatars.discourse-cdn.com/v4/letter/u/f9ae1b/32.png) [@user5e5f0c2b1d27a637](https://community.gravityforms.com/u/user5e5f0c2b1d27a637)\
**Post date:** [March 25, 2021, 3:17pm UTC](https://community.gravityforms.com/t/time-limits-using-an-advanced-time-field-resolved/8450/1 "2021-03-25T15:17:27Z")

</div>

I’m wanting the time fields I’m creating to be limited to a certain time range (e.g. 9am-2pm), but I do not have a field in this form for a date picker, so I cannot use conditional logic from that.

Is there a way to have a stand alone time field have only a specific time available?

Thanks!

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [March 25, 2021, 7:56pm UTC](https://community.gravityforms.com/t/time-limits-using-an-advanced-time-field-resolved/8450/2 "2021-03-25T19:56:49Z")

</div>

HI Walper. Can you create regular drop down fields which only offer the choices from 0900 to 1400, in whatever increments you need (like 15 minutes?) That would give you drop downs rather that number inputs. If you want to use the built in time field number inputs, you could use the gform\_field\_validation filter to ensure that the time is between 0900 and 1400. We have an example of how to restrict the entered time to business hours between 0900 and 1700, here:

> **[gform\_field\_validation - Gravity Forms Documentation](https://docs.gravityforms.com/gform_field_validation/#7-time-field-validation)**
>
> Use this filter to create custom validation logic for a field.

If you have any other questions, please let us know.

---

<div class="post-metadata">

**Author:** ![user5e5f0c2b1d27a637](https://avatars.discourse-cdn.com/v4/letter/u/f9ae1b/32.png) [@user5e5f0c2b1d27a637](https://community.gravityforms.com/u/user5e5f0c2b1d27a637)\
**Post date:** [March 26, 2021, 3:03pm UTC](https://community.gravityforms.com/t/time-limits-using-an-advanced-time-field-resolved/8450/3 "2021-03-26T15:03:53Z")

</div>

Hey Chris!  
Thanks for that response. I’m thinking that code might work. Any idea where I might insert it into Wordpress? I’m new to coding!

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [March 27, 2021, 4:48pm UTC](https://community.gravityforms.com/t/time-limits-using-an-advanced-time-field-resolved/8450/4 "2021-03-27T16:48:31Z")

</div>

Hi Walper. The gform\_field\_validation filter is a PHP filter, and PHP code can go into your theme functions.php file, or you can use a plugin like this to keep the code separate from the theme:

> **[Code Snippets](https://wordpress.org/plugins/code-snippets/)**
>
> An easy, clean and simple way to run code snippets on your site.

We have a little additional information here:

> **[Where Do I Put This Code? - Gravity Forms Documentation](https://docs.gravityforms.com/where-do-i-put-this-code/#php)**
>
> In this article, we will show you where you should typically place code that is within our documentation.

GravityWiz also has an article, if you run into any trouble:

> **[Snippet Troubleshooting - Gravity Wiz](https://gravitywiz.com/documentation/snippet-troubleshooting/)**
>
> Quick Tips Please watch this very helpful snippet installation video. Copy the “raw” version of the snippet via the Download Code button on the snippet article. As a general rule, do not include the opening “

---

<div class="post-metadata">

**Author:** ![user5e5f0c2b1d27a637](https://avatars.discourse-cdn.com/v4/letter/u/f9ae1b/32.png) [@user5e5f0c2b1d27a637](https://community.gravityforms.com/u/user5e5f0c2b1d27a637)\
**Post date:** [March 29, 2021, 4:56pm UTC](https://community.gravityforms.com/t/time-limits-using-an-advanced-time-field-resolved/8450/5 "2021-03-29T16:56:08Z")

</div>

Thank you!!

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [March 30, 2021, 7:54pm UTC](https://community.gravityforms.com/t/time-limits-using-an-advanced-time-field-resolved/8450/6 "2021-03-30T19:54:13Z")

</div>


