Getting around conditional logic limitations (hidden fields not submitting data)

From the docs:
“Fields hidden by conditional logic are ignored on form submission , this is one of the main reasons to use conditional logic and **can’t be changed **.”

Any suggestions for compensating for this limitation?

I’m using conditional logic like “is this value the same as the previous one?” and using the snippet from Gravity Wiz to auto populate the fields. I pulled my hair out for a while trying to figure out why it wasn’t preserving this data with the form submission - and eventually I found the above limitation.

So what are my options?
Custom code to toggle the visibility using a different method than Gravity Forms conditional logic?

So what I ended up doing was creating duplicates for the fields with conditional logic, so - “display field with conditional logic” and “hidden field”. On submit I used the snippet from Gravity Wiz to copy the values from the conditional fields to the hidden fields, which aren’t stripped when processed. Its a pain and Gravity Forms should add the functionality.

You might find our Force Default Values snippet to be even better suited to this issue. It will set the default value of the field on submission if its hidden via conditional logic (and a few other scenarios).

1 Like