BrightLeaf Digital Code Snippet Library

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





Like our snippets? You'll 💜 GravityOps!

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

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, the

This snippet adds a widget to your admin dashboard and embeds your selected form in it. Works well with many add ons such as Nested Forms and Populate Anything and Live Merge Tags. Displays a custom confirmation with a link to the entry (opened in a new tab). Can easily reload the form after submissions. Triggers feeds and notifications and

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 use

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 $forms_and_fields: Add your child form ID as the key, and list the child field IDs you want to keep unique with the message users should see if

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 $forms: nested_field_id: ID of the Nested Form field on the parent