How to get entry value by label

The following function can be used to get a field’s value from an entry, using the label as the key. That is, if you know the label of the field (instead of the id) you can use this function to get the value. function itsg_get_value_by_label( $form, $entry, $label ) { […]

How to add currency suffix – add USD to end of value

The following code will add “USD” to the end of the U.S. Dollar currency in Gravity Forms. For example, instead of seeing $34.20 – $34.20 USD is displayed. This will not affect existing submissions – only newly loaded forms and new submissions. If you’re not sure where to place this code […]

How to expire saved forms after hours or minutes

Gravity Forms comes with the ability for users to save and continue forms. By default forms will automatically expire after 30 days, and this can be customised using the gform_incomplete_submissions_expiration_days filter. Despite the the filter being named “days” you can actually set the expiration to less than days by returning a floating-point […]

How to pre-fill list field fields

The PHP code below shows how to pre-fill a list field in Gravity Forms. This is done using the gform_field_value_$parameter_name filter that allows you to populate a field with values by defining a parameter against a field in the advanced tab. For example, if we set the parameter name to […]

How to add pre-submission review page

Gravity Forms is a powerful plugin for WordPress that allows you to run and manage forms as simple as a contact form or advanced as an application form. There was, until recently, a massive feature missing – a ‘review’ page so form users can review their information before submitting it. […]

How to hide list field ‘remove’ button for particular users

In Gravity Forms the ‘list’ field has a ‘add’ and ‘remove’ button to allow users to add and remove rows. By default all users have the ability to add and remove rows, however with a few simple changes you can control which users can see these buttons. In the example […]

How to require all checkboxes ticked

The following code shows how to make a checkbox field in Gravity Forms require all options be ticked if the field is required. By default, if the field is required only one needs to be ticked. If you’re not sure where to place this code I highly recommend you read How […]

How to output list field column values using custom merge tags

By default Gravity Forms only provides a merge tag for an entire list field. Depending on where it is used it may output a list of values or a table. The following code adds a merge tag that outputs the comma separated values from a list field column. For example […]

How to clear product info table cache

When a payment form in submitted in Gravity Forms a product info table is generated that includes a list of the products purchased and their prices. This information is cached in the rg_lead_meta table as a performance measure – however if the product label changes it will not automatically update […]

How to modify product label on form submit

The following code can be used to automatically change a product label when a form is submitted. In this example we have a book prize form – field id 5 is the title of the book as provided by the form user the ‘product’ is the prize and cost for […]