Gravity Perks
Gravity Connect
Gravity Shop
Snippet Library
Blog
Account
Black Magic
Black Friday Sale
•
Basic
10%
,
Advanced
25%
,
Pro
50%
off
•
Starts Monday, Nov 25th
Gravity Wiz
Gravity Perks
Gravity Perks
A suite of 46+ Gravity Forms addons
Product Details
Pricing
Documentation
Gravity Connect
Gravity Connect
Connect Gravity Forms to top-shelf services
Product Details
Pricing
Documentation
Gravity Shop
Gravity Shop
Bridging Gravity Forms & WooCommerce
Product Details
Pricing
Documentation
Snippet Library
Blog
Account
Log In
Support
Menu
Snippets
Gravity Forms
Snippet Library
/
Gravity Forms
php
Show Unselected Choices
Show unselectecd choices alongside selected choices in your Checkbox and Radio Button field output. This includes support for the {all_fields}...
php
Disable Form Submission
Disables form submission entirely for specified forms.
js
Swap Values in Drop Down & Multiselect Fields
This snippet will add a swap button for any two Drop Down or Multiselect fields. When clicked the value(s) from...
js
Preserve Datepicker Date Selection when Changing Months
A small quality-of-life improvement that preserves the selected date when changing months via the Datepicker. For example, if you selected...
php
Conditional Logic: Fuzzy Comparison for “is” Operator
This snippet adds fuzzy comparison for Gravity Forms' conditional logic "is" operator. This allows you to match values that are...
js
Clear Duplicate Selections
Clear the selection in one Radio Button field when the same value is selected in another.
js
Limit Radio Button Selections across Multiple Fields.
Instructions: Install our free Custom Javascript for Gravity Forms plugin. Download the plugin here: https://gravitywiz.com/gravity-forms-code-chest/ Copy and paste the snippet...
php
Custom Validation
This snippet is an example of how to add custom validation to a Gravity Forms field that is activated by...
php
Entries Left Shortcode
php
Filter Progress Meter by Field Value & Date Range
Adds support to get the count of entries with a specific values within a specific date range.
php
Advanced Conditional Shortcodes
Allows multiple conditions in a single Gravity Forms shortcode.
php
Setting WordPress Default Profile Picture
php
Advanced Merge Tags
Provides a host of new ways to work with Gravity Forms merge tags.
js
Evaluate if All Checkboxes are Checked.
Instructions: Install our free Custom Javascript for Gravity Forms plugin. Download the plugin here: https://gravitywiz.com/gravity-forms-code-chest/ Copy and paste the snippet...
php
Exclude Fields With Personal Information
This snippet shows you how to exclude fields with personal information from instances of the {all_fields} merge tag that include...
php
Update & Create Feeds on Same Form
Allows the creation (and processing) of both "update" and "create" feeds on the same form with the Gravity Forms User...
php
All Fields Template
Modify the {all_fields} merge tag output via a template file.
php
Map GF Checkbox to ACF Checkbox via Advanced Post Creation Add-on
Map Gravity Forms Checkbox fields to ACF Checkbox fields when using the Advanced Post Creation add-on.
php
Better Pre-submission Confirmation
Add pre-submission confirmation to your forms so users can confirm the information they’ve entered is correct.
js
Auto Select Country in Address Field
Automatically selects the user's current country based on IP in a designated address field.
php
Gravity Forms Subtotal Merge Tag
Adds a {subtotal} merge tag which calculates the subtotal of the form.
php
Cache Buster
Bypass your website cache when loading a Gravity Forms form.
php
Calculated Shipping
Use a calculated product field as a shipping field.
php
Catch Help Scout Errors via Email
Use this snippet to send an email directly to your support queue (or administrator) when there is any Help Scout...
php
Capitalize Submitted Data
Capitializes all words in Single Line Text, Paragraph Text, Address and Name fields.
js
Change Field ID via Browser Console
Provides a simple function for changing the ID of a Gravity Forms field via the browser console from the Form...
php
Check If Form Will Be Loaded on Page
This snippet will allow you to check if a form will be loaded on the current page and do something...
js
Check All Checkboxes by Default
Instructions: Install our free Custom Javascript for Gravity Forms plugin. Download the plugin here: https://gravitywiz.com/gravity-forms-code-chest/ Copy and paste the snippet...
php
Map GF Checkbox Field to ACF Checkbox Field (User Meta)
php
Check-In
"Check-in" for Gravity Forms products.
php
Choice Counter
php
Close Comments when Post Created via Gravity Forms
This simple snippet allows you to close comments on posts created via a Gravity Form.
php
Choice Counter
Get the total number of checkboxes checked or multi-select options selected. Useful when wanting to apply conditional logic based on...
php
Update reCAPTCHA widget to use “compact” mode.
php
Conditional Logic: Entry Meta
Use the entry meta in conditional logic (e.g. payment status, approval status, etc).
php
Enable Current Field in Conditional Logic
Enable use of the current field when creating conditional logic rules in the form editor.
js
Conditionally Disable Checkboxes
Disable checkboxes in one Checkbox field depending on the values checked in another.
php
Conditional Logic Operator: “Is In”
Check if a source value is in a comma-delimited list of values.
php
Convert to 2-Letter Abbreviation
Convert the submitted state to its 2-letter abbreviation on submission (e.g. Virginia → VA). Invalid states will return a validation...
php
Allow Zero Amount Coupons
Create coupons with the amount of zero.
html
gw-copy-button-for-save-and-continue-link.html
php
Create Coupons with Gravity Forms for Gravity Forms, WooCommerce, or Easy Digital Downloads
Create coupons via Gravity Forms submissions. Map the coupon code to a field on the GF form and voila!
php
Exclude Products from Coupon Discount
Exclude specific products when calculating discounts with the Gravity Forms Coupons add-on. Requires Gravity Forms Coupons v1.1
php
Create Coupons with Gravity Forms for Gravity Forms
js
Current Time Button
Append an "Insert Current Time" button to Time fields that populates the current time when clicked.
php
Move Currency Symbol from the Right to the Left (i.e. “0,00 €” to “€ 0,00”)
php
gw-custom-activation-template.php
php
Current Time Merge Tags
Set the default value of a Time field to the Current Time.
php
Daily Form Schedule
Allow your form schedule to apply daily.
php
Dashboard Widget Forms
Add a Gravity Form as a dashboard widget.
php
Dashboard Widget Controls
Select which forms you would like to display in the Gravity Forms Dashboard widget.
php
Delete Files After Notifications Sent
This snippet will automatically delete all uploaded files after notifications have been sent. This pairs well with Gravity Forms' "Attach...
php
Calculate Number of Days Between Two Gravity Form Date Fields
Get the latest version: Allows you to calculate the number of days between two Gravity Form date fields and populate...
php
Disable Auto-complete
Disable browser auto-complete.
js
Disable Submission when Pressing Enter
php
Disable HTML5 Validation
Disable HTML5 validation on your Gravity Forms
php
Display File Upload Merge Tags as Images
This snippet simplifies the logic in both Preview Submission and the Multi-file Merge Tags snippet to create a very basic...
php
Disable Submit Button Until Required Fields are Filled Out
Disable submit buttones until all required fields have been filled out. Currently only supports single-page forms.
php
Display Entries Left Based on Entry Limit
php
Double Confirmation Fields
Require a field's value to be entered twice to confirm it.
php
Display Price for Drop Down and Radio Button Product Fields
Appends the price of a product to the Labels of a Dropdown and Radio Button Product Fields.
php
Dynamically Populate Unix Timestamp
Set a field's dynamic population parameter to "timestamp" to populate the current Unix timestamp.
js
Drop Down Lockouts
Only allow a selection in a single Drop Down field, disabling other Drop Down fields in that group.
php
Use Merge Tags as Dynamic Population Parameters
This snippet enables the ability to use merge tags as dynamic population parameters, allowing you to specify default values for...
php
Dynamic Range
Set a Number field's minimum and maximum range by the values entered in to other fields.
php
Create Dynamic Post Excerpts with Gravity Forms
This snippet allows you to create your own content template for the Post Excerpt.
php
Dynamically Populating User Role
Use this snippet in conjunction with Gravity Forms dynamic population functionality to populate the current user’s role into any form...
php
Email Domain Validator
Exclude a list of invalid domains or include a list of valid domains for your Gravity Form Email fields.
php
Edit Products & Payment Details
Edit products (and payment details) via the Gravity Forms Edit Entry view.
php
Email Groups
Send notifications to a group of predefined emails with the power of merge tags! Define your email groups below and...
php
Embeddable Forms
Combine multiple forms to create a single form. WARNING! This is an experimental snippet. You will likely encounter bugs for...
php
Email Header to Identify Notification Source
Add a custom email header to identify the URL that generated the Gravity Forms notification.
js
Enable Other Months Dates
By default, when viewing the datepicker, any visible dates in the previous or next months are disabled. This snippet will...
php
Entry Count Shortcode
Extends the [gravityforms] shortcode, providing a custom action to retrieve the total entry count and also providing the ability to...
php
Display a Filterable Entry Count
php
Export Multi-input Fields in a Single Column
Export multi-input Gravity Forms fields as a single column.
php
Exclude Specific Forms from Gravity Forms Dashboard Widget
STOP! If you’re looking for a way to include or exclude specific forms in your dashboard widget, check out our...
php
Feed-specific Submit Button
Change the label of the submit button depending on which payment feed will be used to process the order.
php
Field to Field Conditional Logic
Compare fields in Gravity Forms conditional logic.
php
Field Notes
Add a field setting for capturing notes about the field.
php
Give First Validation Error Focus
Automatically focus (and scroll) to the first field with a validation error.
php
Force Default Value
Force the default value to be captured for fields hidden by conditional logic.
js
Focus Next Field on Enter
php
Form Loading Indicator
php
Default Form List to Active Forms
Sets Form List view to Active Forms by Default.
php
Form Schedule Wildcards
Use wildcards for the month, date, or year in your form schedule start and end dates.
php
Get Form ID by Form Title
php
Format Date Merge Tags
Adds merge tag modifiers for formatting date merge tags using PHP Date Formats.
php
Custom Javascript
Include custom Javascript with your form.
php
Get Total Paid by Email
Use this helper function to get the total paid across all forms for a email address. Example: $total = gw_get_total_by_email(...
php
Filter Out $0.00 Products
Use this snippet to hide Product fields from the order summary when their cost is $0.00. Note: this snippet was...
php
Rename Uploaded Files
Rename uploaded files for Gravity Forms. You can create a static naming template or using merge tags to base names...
php
gw-gravity-forms-rename-uploaded-files-usage.php
php
Calculation Subtotal Merge Tag
Adds a {subtotal} merge tag which calculates the subtotal of the form.
php
Rounding by Increment
Round your field values (including calculations) up, down, by an increment, or to a specific minimum or maximum value.
php
gw-hide-css-fields-from-all-fields.php
php
Hide All Non-visible Fields via Modifier
This automatically hides all non-visible fields when the:nohidden modifier is used with the {all_fields} merge tag.
php
Include HTML Fields in {all_fields} Merge Tag By Default
php
Hide Dynamically Populated Fields
Use this snippet to automatically hide fields that are dynamically populated. Works with fields populated via Easy Passthrough, Populate Anything,...
php
Include Option Label & Value in Order Summary
By default, Gravity Forms only includes select options' labels or values depending on the context. Use this snippet to include...
php
Better Inventory
Specify an inventory for any Gravity Forms field.
php
Post Permalink Merge Tag
Provides a link immediately to preview their newly created post.
php
Limit Multi Selects
Set a minimum and maximum number of choices that can be selected in a Multi Select field. Optionally, set the...
php
Limit How Many Checkboxes Can Be Checked
Limit how many checkboxes can be checked (and how many checkboxes must be checked) on a checkbox field.
php
Use List Field as Choices for Gravity Forms
Adds support for populating choice-based fields with values entered in a List field.
php
Use List Field as Choices for Gravity Forms
php
Live Preview
Preview your Gravity Forms on the frontend of your website
php
Send Manual Notifications
Create custom notification event that can be sent manually.
php
Manual Entries
Create entries manually for Gravity Forms. Adds an "Add New" button next to the page title on all entry-related pages.
php
Display Checkmarks for Checkboxes
Use the ":checkmark" modifier to display a checkmark for checkbox values. Will only display a checkmark if the checkbox is...
php
Merge Tag: Blog ID
php
Append/Prepend Values to Merge Tags
Append or prepend a string to a merge tag's output only when it has a value.
php
Sentence Merge Tag Modifier for Checkboxes
Use the :sentence modifier on Checkbox field merge tags to convert... this: First Choice, Second Choice to: First Choice and...
php
Require Minimum and Maximum Character Limit for Gravity Forms
Adds support for requiring a minimum and maximum number of characters for text-based Gravity Form fields.
php
Merge Tag: Add merge {tab} for tabbed space.
Adds merge tags {tab}, {space}, and {newline}.
php
Set a Minimum Order Quantity
php
Multi-File Merge Tag for Post Content Templates
Enhance the merge tag for multi-file upload fields by adding support for outputting markup that corresponds to the uploaded file.
php
Modify Thousandths Separator
php
Multiple Entries by List Field
Create multiple by entries based on the rows of a List field.
php
Notes Merge Tag
Include entry notes in notifications (and other places merge tags are supported after an entry has been created).
js
“None of the Above” Checkbox
Use this snippet to enable a proper "None of the Above" option in your Checkbox fields. If any other option...
php
Notification Events
Create custom notification events for Gravity Forms. Currently supports entry field update conditions. Future support will be added for time-based...
php
Notify User When Submitted Post is Published
Send an email to a user when the post they submitted is published.
php
Notify Author When Post is Published
Send an email to the post author when the post is published.
php
Populate the Current Quarter
css
Numbering List Field Rows
Automatically number your Gravity Forms List field rows. To use the CSS, add the 'gw-number-rows' class to the List field's...
php
Populate Date One Year from Current Date
php
Populate Dates as Choices
By default, this snippet will populate the next 14 "valid" dates as choices in any choice-based fields (e.g. Drop Down,...
php
Populate Date
Provides the ability to populate a Date field with a modified date based on the current date or a user-submitted...
js
Preserve Field Value on Conditional Logic Hide
php
Prevent Duplicate Selections
Prevent duplicate selections in choice-based fields. Currently works with Checkbox, Radio Button, Drop Down and Enhanced-UI-enabled Multi Select fields.
js
Prioritize Next Button Over Save and Continue When Pressing Enter
php
Prevent Duplicate Submissions from Double Clicks
Disable the submit button after the initial click to prevent double clicks.
php
Progress Meter
Display a meter indicating your progression towards a set goal based on your Gravity Forms entries.
php
Query Param Merge Tag
Adds {query_param:PARAM} merge tags for pulling values from query/GET params.
php
Accept Decimal Values for Quantity Fields
Allows you to accept decimal values in Quantity fields.
php
Redirect if Email Exists
Redirect to a specified URL if the the submitted email address matches an existing user.
php
Random Fields
Randomly display a specified number of fields on your form.
php
Remove Empty Emails from Notification Email Lists
If you're passing merge tags as an email list (e.g. {admin_email},{Email:1},{Alternate Email:3}) and one of those emails is empty, Gravity...
php
gw-require-list-columns.php
php
Replace Page Numbers with Letters
php
Require Unique Values Between Fields
Require two or more fields on the same form to be different from each other.
php
Require Unique Values Between Fields
php
Restrict States in Address Fields
Restrict the states that can be selected for Address fields. Either restrict specific fields or restrict all Address fields on...
php
Save & Continue Auto Load
Automatically save users' data as they progress through a form and automatically repopulate that data when they return.
php
Round Robin
Cycle through the choices of a designated field assigning the next available choice when an entry is submitted. The cycle...
js
Scientific Notation for Calculations
Display calculation results in scientific notation (e.g. 176,021,565,000 → 1.760e11).
php
Schedule a Post by Date Field (for Multiple Forms)
Schedule your Gravity Form generated posts to be published at a future date, specified by the user via GF Date...
js
Add “Select All” Button for Multi Select Field
Works with GP Advanced Select!
php
Set Entry Creator by Field Value
Set the entry creator by field value. The value must be a valid WordPress user ID.
php
Send Notifications to Merge Tags
Use any merge tag in your notification's "Send to Email" setting.
php
Set Post Status by Field Value (Advanced)
php
Set Number of List Field Rows by Field Value
This snippet adds/removes list field rows automatically based on the value entered in the specified field.
php
Set Post Status by Field Value
php
Set Post Status by Product Field Value
php
Custom Field Properties via [gravityforms] Shortcode
Specify custom field properties with the "field_props" attribute for the [gravityforms] shortcode.
php
Populate Range by Another Field
Set a field's minimum and maximum range by the values of other fields. Currently, this will only work with default...
php
Show Form on Confirmation
Include the form and the confirmation message after a successful submission.
php
Shortcodes as Merge Tags
Convert shortcodes into merge tags on the fly! See usage instructions below. Requires Gravity Forms 2.4.17.2+.
php
Show Page Name in Form Editor
http://gravitywiz.com/
php
Simple Approval with Save and Continue
A simple, single-step approval process for your Gravity Forms submissions.
js
Show Two Decimals for Calculation Results
Always show two decimals in your calculation results (e.g. 1.00, 1.50). Most often if you need to show two decimals...
php
Skip Pages on Multi-Page Forms
php
Spam Notification
Send notifications when an entry is marked as spam.
php
Skip Registration for Logged In Users
Skip registration if the user is logged in.
css
Styling Page Steps
php
Split Testing for Gravity Forms
Allows you to test the effectiveness of two or more Gravity Forms by using a single shortcode (or function call)...
php
Limit Submissions Per Time Period (by IP, User, Role, Form URL, or Field Value)
Limit the number of times a form can be submitted per a specific time period. You modify this limit to...
php
Submit to Access
Require that a form be submitted before a post or page can be accessed.
js
Submit from Any Page
Allow submission of a form from any page by adding a "Submit Now" button to each page. This can be...
php
Tag Editor
Provides the ability to more easily modify the properties of specific tags in Gravity Forms markup. Currently supports the tag.
php
Convert Time Field Inputs to Drop Downs
php
Three Decimal Currencies
php
Time Sensitive Choices
Filter time-based choices based on the current time.
php
Time Sensitive Choices
php
Tiny Mailing List
Send a notification to multiple recipients individually.
php
Unrequire Required Fields for Testing
When bugs pop up on your forms, it can be really annoying to have to fill out all the required...
php
Exclude characters from GPUID
Allows you to exclude characters from unique IDs generated using GPUID.
php
Update Posts
Update existing post title, content, author and custom fields with values from Gravity Forms.
css
Use Text for List Fields Add/Remove Buttons
Screenshot: https://gwiz.io/42a3CCC
php
Uppercase Entry Value (by Field)
php
Delete Entry Files When User Deleted
Delete entry files associated with user when user is deleted. This snippet only works when the user was created or...
php
Update by Email
Create User Registration feeds that will update the user by the submitted email address, allowing non-logged-in users to be targeted...
php
Skip Registration if Email Exists
If submitted email is already registered, skip registration.
php
Validate Current Password
Require users to confirm their current password before changing their password.
php
Zip Uploaded Files
Create a zip file from all uploaded files and attach it to a notification.
php
Validate that a Value Exists
Ensure that a value entered in Form A has been previously submitted on Form B. This is useful if you're...