Sometimes when we’re building a large form in Gravity Forms, the client will ask for a section or a whole page to be removed “temporarily” while they review it, but have the rest of the form go live. That poses a challenge: we’ve built the whole form, including the section they want to remove for now, but will want to have it return later after review.
Physically removing fields from a form, and returning them later on, is work. There’s no version control on forms, and no merge to bring back chunks of form that have been deleted. This is harder still, if we’ve built a chain of fields with interdependent conditional logic between them. Rather than physically removing fields, the easier option is to hide them!
Gravity Forms supports conditional logic on nearly all types of fields. That includes nested fields like sections and pages! If we’re building a complex form, the chances are that it will have multiple pages and / or sections, and if we’re careful, we can organise the fields we need to temporarily hide into pages or sections. Then we can use conditional logic to hide them, just for now!
Normally, when we use conditional logic to hide something on a form, that something will show depending on the value of another field on the form. But if we don’t want to show a page or section at all, ever, until the client says it’s OK to, we can set the condition such that it will only show when some field matches a value it will never have. What sort of value is that? Something that a random visitor typing values in will be very unlikely to type. Unguessable. Like a generated password value.
There’s many password generators on the Internet, and if we are using a password manager (and we all should be!) it will be able to generate a nice random string of characters. On Linux, I like to use the command line password generator pwgen (installed from the package manager): give me a string 32 characters long, secure, with letters and numbers, but no symbols (so it’s easy to select / copy and paste).
pwgen -sn 32
Then we can add conditional logic to our page or section, pick some field on the form, and configure our section to show only if that field has a value matching our generated password string.
And now the section will be hidden on the live form, with no visitors ever seeing it, while the client can continue to review it on the staging website. Of course, any changes they want made to that section should be made on the live site and migrated to the staging site for further review, but at least our development flow can be maintained.