New on the blog: why AI belongs in the feed →

BrightLeaf Digital Code Snippet Library

Check out our growing library of code snippets for Gravity Forms!

Eleven of these snippets register their own shortcodes. Every tag and attribute is in our Gravity Forms shortcodes reference. Need a Gravity Forms or GravityView shortcode built for you? Try the free shortcode builder.





Like our snippets? You'll 💜 GravityOps!

Results

Goal This code snippet ensures that the sum of all child entries in a Gravity Forms nested form does not exceed the total specified in the parent form. It validates the "Amount" field in child entries against the "Total" field in the parent form, preventing over-allocation of resources, budgets, or quotas. Shows a detailed, currency-formatted message if the attempt would …

Goal This JavaScript snippet disables dropdown choices in a Gravity Forms nested form to prevent duplicate selections across child entries within the same batch. When a user selects an option in one child entry, it becomes unavailable in subsequent child entries, ensuring unique selections. JS snippet to be installed on child form. Make sure to replace the parent form id, …

Goal This code snippet ensures that child form submissions in Gravity Forms do not exceed the available balance recorded in a GravityView ledger. It validates disbursal requests against the user's balance, preventing over-allocation of funds across multiple pending and approved submissions. Each array at the top of the snippet is for a different form with it's own ledger. You can …

Goal Adds an "Export Layout" button to the Gravity Forms editor that copies a full HTML visual layout of the form to the clipboard, ready to paste straight into a Google Doc. Useful for handing a form's structure to someone who does not have admin access, and for keeping a readable record of how a form was built. Requirements Gravity …

Goal Adds "Export Layout" button to Gravity Forms editor that exports form structure as formatted HTML table to clipboard. Includes field labels, types, conditional logic, and Gravity Populate Anything (GPPA) settings for documentation purposes. Usage Navigate to Forms > Edit Form in WordPress admin Click "📋 Export Layout" button in toolbar Script copies formatted table to clipboard Opens new Google …

Goal When using Nested Forms, prevent duplicate values across multiple child entries in the same batch/session for specific fields you choose (e.g., a number field, a name field, or a date field). Configuration Edit the config block below. Installed through GOCSM, these values are fields and survive snippet updates. $forms_and_fields: Add your child form ID as the key, and list …

Goal This code snippet enforces validation on a Gravity Forms Nested Form field, ensuring that at least one child entry in a batch contains a specific value in a selected field. If no child entry meets the requirement, the form submission is blocked, and a validation message is displayed. CONFIGURATION Edit the config block below. Installed through GOCSM, these values …

Goal Monitors Gravity Flow workflows and alerts administrators when workflow fails to start after form submission. Critical for catching workflow configuration errors, conditional logic issues, or system failures that prevent automated processes from running. Checks both parent and nested child forms. Configuration Edit the config block below. Installed through GOCSM, these values are fields and survive snippet updates. $to: Add …