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.
Require at least one child entry in batch to have specified value for selected field
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 are fields and survive snippet updates.
$forms:nested_field_id: ID of the Nested Form field on the parent formchild_field_id: ID of the field on the child form to checkrequired_value: String value required in at least one child entrymessage: Validation message to show if requirement is not met
This code is best installed directly on your site using the Code Snippets plugin.
Loading...
Review this entry
You must be logged in to post a comment.